React-Apollo error: "…only supports a query, subscription, or a mutation per HOC"

I am trying to create two separate mutations in this format:

import gql from 'graphql-tag';

const MUTATION = gql`
  mutation setItem($item:String!) {
    setItem(item:$item)
  },
  mutation setAnotherItem($setAnotherItem:Bool) {
    setAnotherItem(setAnotherItem:$setAnotherItem)
  }
`;

But I am getting this error:

Invariant Violation: react-apollo only supports a query, subscription, or a mutation per HOC. [object Object] had 0 queries, 0 subscriptions and 2 mutations. You can use 'compose' to join multiple operation types to a component

What is the proper way to structure this so that both mutations are usable?

244 thoughts on “React-Apollo error: "…only supports a query, subscription, or a mutation per HOC"”

  1. Greetings I am so delighted I found your weblog, I really
    found you by error, while I was looking on Yahoo for something
    else, Nonetheless I am here now and would just like to say many thanks for a marvelous
    post and a all round thrilling blog (I also love the theme/design),
    I don’t have time to read through it all at the moment but I have
    saved it and also added in your RSS feeds, so when I have time I will be back to
    read a great deal more, Please do keep up the great job.

    Reply
  2. Good day! I know this is kinda off topic however , I’d figured
    I’d ask. Would you be interested in trading links or maybe guest authoring a blog article or vice-versa?
    My blog addresses a lot of the same subjects as yours and I feel we could greatly benefit from each other.
    If you are interested feel free to send me an e-mail. I look forward to hearing from you!
    Terrific blog by the way!

    Reply
  3. Great article! That is the type of information that are
    meant to be shared across the internet. Shame on Google for now not positioning this submit higher!
    Come on over and talk over with my website .
    Thanks =)

    Reply
  4. I loved as much as you’ll receive carried out right here.

    The sketch is tasteful, your authored subject matter stylish.
    nonetheless, you command get got an edginess over that you wish be delivering the following.
    unwell unquestionably come further formerly again since exactly the same nearly very often inside case you shield this hike.

    Reply
  5. First of all I would like to say awesome blog! I had a quick question that I’d like to ask if you
    do not mind. I was interested to find out how you
    center yourself and clear your head before writing. I have had trouble clearing my mind in getting my
    ideas out there. I do enjoy writing but it just seems like the
    first 10 to 15 minutes tend to be wasted just trying
    to figure out how to begin. Any ideas or hints?
    Many thanks!

    Reply
  6. Hello there, just became alert to your blog through Google,
    and found that it’s really informative. I am gonna watch out for brussels.

    I will be grateful if you continue this in future.
    Lots of people will be benefited from your writing.
    Cheers!

    Reply
  7. I would like to thank you for the efforts you have put in penning this blog.
    I really hope to check out the same high-grade blog posts by you in the future as well.
    In fact, your creative writing abilities has inspired me to get
    my very own website now 😉

    Reply
  8. I am extremely impressed with your writing skills as well as with the layout
    on your weblog. Is this a paid theme or did you modify it yourself?
    Anyway keep up the excellent quality writing, it is rare to see a nice blog like
    this one nowadays.

    Reply
  9. What i don’t understood is if truth be told how you
    are no longer actually much more well-preferred than you
    may be now. You’re so intelligent. You understand thus significantly when it
    comes to this topic, made me in my opinion imagine
    it from numerous varied angles. Its like men and women don’t seem to be interested until it is
    something to accomplish with Girl gaga! Your individual stuffs great.
    Always handle it up!

    Reply
  10. Admiring the time and energy you put into your blog and in depth information you provide.
    It’s great to come across a blog every once in a while that isn’t the same out of
    date rehashed material. Excellent read! I’ve
    saved your site and I’m including your RSS feeds to my Google account.

    Reply
  11. Hi there! I could have sworn I’ve been to this blog
    before but after checking through some of the post I realized it’s new to me.
    Anyways, I’m definitely glad I found it and I’ll be book-marking and checking back frequently!

    Reply
  12. Hiya very cool blog!! Man .. Beautiful .. Superb ..
    I will bookmark your web site and take the feeds additionally?

    I am happy to find a lot of useful info here in the put up, we need work out more strategies in this regard, thanks for sharing.
    . . . . .

    Reply
  13. Does your blog have a contact page? I’m having a tough time
    locating it but, I’d like to send you an e-mail. I’ve got some suggestions for your blog you might be interested in hearing.
    Either way, great blog and I look forward to seeing it develop over time.

    Reply
  14. Hi, I believe your website might be having web browser
    compatibility problems. When I look at your blog in Safari,
    it looks fine but when opening in I.E., it’s got some overlapping issues.

    I simply wanted to provide you with a quick heads up!
    Apart from that, wonderful site!

    Reply
  15. Hi I am so excited I found your website, I really found you by mistake, while I was browsing on Askjeeve for something else, Anyhow I
    am here now and would just like to say thanks a lot for a tremendous post and a
    all round enjoyable blog (I also love the theme/design), I don’t have time to read it all at
    the moment but I have book-marked it and also added your RSS feeds,
    so when I have time I will be back to read much more, Please do keep up the excellent work.

    Reply
  16. Hello just wanted to give you a brief heads up and let you know a few of the pictures aren’t loading correctly.
    I’m not sure why but I think its a linking issue. I’ve tried it in two different browsers and both show the same outcome.

    Reply
  17. I think that everything said made a bunch of sense.
    However, what about this? suppose you added a little content?
    I ain’t suggesting your content isn’t good, however suppose you added something to maybe grab folk’s attention? I mean React-Apollo error:
    "…only supports a query, subscription, or a mutation per HOC" – JavaScript
    Help is a little boring. You ought to look at Yahoo’s front page
    and watch how they write post headlines to get viewers interested.
    You might try adding a video or a picture or two to grab
    people excited about everything’ve got to say.
    In my opinion, it could bring your posts a little livelier.

    Reply
  18. You really make it seem really easy with your presentation but I find this topic to be really one thing which I believe I would never understand.
    It kind of feels too complex and extremely vast for me.

    I am looking forward in your next put up, I’ll try to get the cling of it!

    Reply
  19. This is really interesting, You’re a very skilled
    blogger. I’ve joined your rss feed and look forward to seeking more of your wonderful post.
    Also, I have shared your site in my social networks!

    Reply
  20. Thanks for every other excellent article.
    Where else may just anybody get that type
    of information in such an ideal method of writing? I have a presentation next week, and I am on the
    look for such info.

    Reply
  21. I’m really impressed together with your writing skills
    and also with the structure on your weblog. Is this a paid subject
    or did you modify it yourself? Either way stay up the excellent high quality
    writing, it’s uncommon to peer a nice weblog like this one these days..

    Reply
  22. An impressive share! I have just forwarded this onto a colleague who had been doing a little research on this.
    And he in fact bought me lunch because I stumbled upon it for
    him… lol. So let me reword this…. Thank YOU for the meal!!
    But yeah, thanks for spending time to talk about this matter here on your
    site.

    Reply
  23. I’m not sure where you are getting your info, but great topic.

    I needs to spend some time learning much more
    or understanding more. Thanks for excellent info I was looking for
    this info for my mission.

    Reply
  24. Thank you, I have recently been searching for info approximately
    this subject for a while and yours is the greatest I
    have found out so far. However, what in regards to the bottom line?

    Are you positive about the source?

    Reply
  25. I was curious if you ever thought of changing the structure
    of your site? Its very well written; I love what youve
    got to say. But maybe you could a little more in the way of content so people could
    connect with it better. Youve got an awful lot of text for only having 1 or 2 images.
    Maybe you could space it out better?

    Reply
  26. Heya i’m for the first time here. I found this board and I find
    It truly useful & it helped me out much. I hope to give something
    back and aid others like you aided me.

    Reply
  27. i need loan urgently in dubai, i need loan urgently. i need a quick loan no credit check i need loan need a loan fast i need 2 lakhs loan, guaranteed cash advance loans bad credit, cash advances, cash advance, cash advance loans with no credit check. Business have acquired economics, internationally active.

    Reply
  28. I like the helpful information you provide in your articles.

    I will bookmark your blog and check again here frequently.
    I am quite sure I will learn many new stuff right here!

    Good luck for the next!

    Reply
  29. Good day I am so excited I found your blog, I really found you by accident, while I was searching on Yahoo
    for something else, Regardless I am here now and would just like to
    say thanks for a incredible post and a all round entertaining blog (I
    also love the theme/design), I don’t have time to read it
    all at the moment but I have bookmarked it and also
    added your RSS feeds, so when I have time I will be back
    to read a lot more, Please do keep up the superb job.

    Reply
  30. Does your site have a contact page? I’m having
    trouble locating it but, I’d like to send you an email.
    I’ve got some suggestions for your blog you might be interested in hearing.
    Either way, great website and I look forward to seeing it
    improve over time.

    Reply
  31. Hello, i read your blog from time to time and i own a similar one and i
    was just wondering if you get a lot of spam feedback?
    If so how do you protect against it, any
    plugin or anything you can suggest? I get so much lately
    it’s driving me crazy so any assistance is very
    much appreciated.

    Reply
  32. You can certainly see your skills in the article you write.
    The world hopes for more passionate writers such as you
    who aren’t afraid to mention how they believe. Always follow your heart.

    Reply