Page tree
Skip to end of metadata
Go to start of metadata

The architecture for a mutation is to pass in an input object and one or more return objects to define what data a successful mutation should return. Because a mutation also makes a query, it is recommended you read GraphQL Queries section first.

The input object is an implementation of the IDataSenderBuilder interface, InputDataSenderBuilder. Most mutations expect objects, so take an InputDataSenderBuilder. This is a Java object containing the mutationName and the fieldsMap, a Map of field keys and values which contains the content being passed.The fields are defined in an enum in the relevant GraphQLMutation.

In addition, one of more return objects also need to be passed, to determine the content to return from the query. These return objects also implement the IDataSenderBuilder interface and define what should be returned. Unlike queries, the response may be an object or it may be just a single scalar json value. Consequently, there are two different classes that a return object may be, an ObjectDataSenderBuilder and a ScalarDataSenderBuilder. See specific mutations for further details.

The input and output objects are passed into the mutation object, a class extending BaseGraphQLMutation (the mutation equivalent of what exists for queries, the BaseGraphQLQuery). This is passed to a GraphQLRequest, which is added as the request for an endpoint. This process should be familiar from queries. There are also helper methods from the WWClient class to reduce the complexity of layers.

The following code block will demonstrate the full process (this is a WWClient object that corresponds to an authenticated WWClient).

ArrayList<String> members = new ArrayList<String>();
InputDataSenderBuilder spaceInput = new InputDataSenderBuilder(Space.UPDATE_SPACE_MUTATION_NAME);
spaceInput.addField(UpdateSpaceFields.ID, spaceId);
spaceInput.addField(UpdateSpaceFields.TITLE, "My new title");
spaceInput.addField(UpdateSpaceFields.MEMBERS, members);
spaceInput.addField(UpdateSpaceFields.MEMBER_OPERATION, UpdateSpaceMemberOperation.ADD);
ObjectDataSenderBuilder returnObject1 = new ObjectDataSenderBuilder(Space.ONE_SPACE_QUERY_OBJECT_NAME);
ScalarDataSenderBuilder returnObject2 = new ScalarDataSenderBuilder(MEMBER_IDS_CHANGED_FIELD);
SpaceUpdateGraphQLMutation mutationObject = new SpaceUpdateGraphQLMutation(spaceInput, returnObject1, returnObject2);
ep.setRequest(new GraphQLRequest(mutationObject));
UpdateSpaceContainer output = ep.getResultContainer().getData().getUpdateSpaceContainer()

Lines 1-2 create an ArrayList containing the single member we want to add to access for the Space.

Lines 3 - 7 create the InputDataSenderBuilder, passing the ID of the space we want to update, the title we want to rename the space with, the members we want to update and the "ADD" enum to tell Watson Workspace we want to add rather than remove this user.

Lines 8 - 9 create an ObjectDataSenderBuilder which is a very basic getSpace query to return the space's title. Unlike the normal getSpace query, we don't need to ask for the ID of which space to return. We're returning data for the space we're updating in the mutation.

Line 10 creates a ScalarDataSenderBuilder to echo the array of members updated.

Line 11 passes the input object and the two return objects into a new instance of a class extending BaseGraphQLMutation. Classes are available for all query types and will create a default method name, e.g. "updateSpace".

Line 12 passes the query object into a new GraphQLRequest, and sets this as the request for the GraphQLEndpoint. Line 20 executes the request.

Line 14 then uses GSON to parse the result container and get an UpdateSpaceContainer which will contain the Space and an array of the member ids changed. Lines 12 - 14 could be reduced into a single line by using a helper method from the WWClient class that takes just the new instance of a class extending BaseGraphQLQuery:

UpdateSpaceContainer result = client.updateSpaceWithMutation(new GraphQLRequest(mutationObject));

On occasion a mutation may only accept fixed input and only return a fixed output. The deleteSpace mutation is one such mutation. As a result, there are no methods for passing input and output objects, just simple methods in WWClient.


  1. Anonymous

    Do more with OneDrive and Office 365 Create polished documents,]office  unlock insights, present with clarity, and collaborate in real-time using Office 365.

  2. Anonymous

    Fix printer problems in Windows 10. When you connect a printer to your PC or add a new printer to your home network, you can usually start printing right away. Windows supports most printers, and you probably won't have to go out of your way to install special printer software.

  3. Anonymous

    Install mcafee product without any hassle. We provide best installation service click here for more details :

  4. Anonymous

    office it the package of office tools to make your working smooth and effective. Get it downloaded in your computer with the fast help.

  5. Anonymous

    Exceptional technical assistance for setting up office 365 in your computer or laptop. just give us a call on our number and we are ready to give you the best help.

  6. Anonymous

    Present norton antivirus with the best help gathering and keep your PC contamination free. Download norton antivirus with the best help gathering and avoid disease attacks.

  7. Anonymous

    To get started Office 2019,   2016 and office 365 download or installation you must need valid 25 character product key,

  8. Anonymous

    Webroot is a best-known antivirus software protects your devices against phishing, ransom attacks, viruses and malwares. visit here for more details : It can keep your data, files and essential information safe and also scan your files against online threat.

  9. Anonymous

    Here you can get item keys for Office 365 full form and individual Office apps. Here we are giving full help to introduce office bundle click here for more subtleties.

  10. Anonymous

    norton help to ensure your gadgets against antiviruses and offer security to client and giving personality and contraption affirmation to your related life.

  11. Anonymous

    mcafee antivirus is widely used aantivirus helps to detect and neutralize computer virus, the mail worms,the trojan programs,and also helps your system free of virus and other malware is quite a daily challenge. for more details  visit  here.

  12. Anonymous

    Get started with Office product by downloading and installing it. Type the product key at

  13. Anonymous

    Norton Setup Internet and Device Security. Norton give total seCurity to web and device.Every business constantly expected to send the record and subtleties material and everybody needs to beyond any doubt that the archives that are sending the best possible and unique arrangement.

  14. Anonymous

    To stop the malware from damaging the folders on the device,  McAfee Antivirus software has to be downloaded in the device. After downloading the McAfee Antivirus, the protection for the system data automatically gets started.

  15. Anonymous

    On the off chance that you need to reinstall office or fix it, you can reverify your item key on setup page and can download more established form of office

  16. Anonymous

    Every people should read this post at least once.  I definitely looking forward for more informative posts.

    Ida Wallace, Senior Assignment Writer,

  17. Anonymous

    Such a knowledgeable post about Building Mutations with the SDK. I am happy to found this post.

    William Riley,

  18. Anonymous

    Such an amazing post. I am glad to found this post and I enjoyed to read it.

    Jack Ponting, Assistant Dissertation Writer

  19. Anonymous

    Roku gives the least troublesome way to deal with stream redirection to your TV.   On your terms  With countless channels to peruse.

  20. Anonymous

    Steps to Activate Avg retail enlistment Once you install AVG retail activation on your framework, you require to activate it as without activation it is extraordinary to get its feature.   In this way, enact AVG antivirus by following given advances carefully.

  21. Anonymous

    After you buy Norton Antivirus visit  sign in to norton account then enter norton product for Norton Setup or Install Norton Antivirus

  22. Anonymous

    norton com  download, establishment and enactment.   The web slanted world structures the need of an antivirus that can verify your data and besides ensure safe taking a gander at and what's more guaranteed trades over the web

  23. Anonymous

    This is least troublesome approach to manage stream actuation to your TV.   On your terms. Wit h an extensive number of accessible channels to research for more details.visit:  today.

  24. Anonymous

     Steps to interface your Player to your TV.   Roku activate device is the easiest method to stream stimulation to your TV. visit for roku .

  25. Anonymous

     offer total security of sensitive files over the entirety of your gadgets that incorporate a wide range of IOS gadgets,   OS gadgets just as Android devices.

  26. Anonymous

    webroot cyber security is a ultimate internet security suite for complete protection against today's diverse range of threat on windows. key features are 100% secure secure shopping, 1 click virus scanning,   malicious website filtering, unblock antivirus.if you want to install it then visit our site:

  27. Anonymous

    Download norton antivirus to make your computer virus free with the best support and tech team.   Feel free to contact us

  28. Anonymous

    To enact the Norton setup, select the Activate Now option at the base. To recharge the membership for Norton, select the Help choice and snap on Enter item key. Cautiously type the right Norton item key in the clear.  Snap on the Next catch.Go through with  for more details.

  29. Anonymous

    webroot is a light weighted software,install extreme digital security at webroot safe or at webroot safe introduce   click here to download webroot safe.

  30. Anonymous

    Much obliged to you for picking Webroot web security.   You're nearly secured! Essentially complete the accompanying strides beneath to finish your introduce.

  31. Anonymous

    Webroot Antivirus Software Installation Requirements As we realize that Webroot is security programming and antivirus that give a   high-class insurance to both individual and expert use.

  32. Anonymous

    It is all time best protective  antivirus and anti-spyware .It is real time protection  technology and it is safer ,   faster and more complete than ever before.if  want to install it then visit our site.

  33. Anonymous

    It is all time best protective  antivirus and anti-spyware .It is real time protection  technology and it is safer ,   faster and more complete than ever before.if  want to install it then visit our site.

  34. Anonymous

    I am so happy to found this website and I also got very informative contents from this website. Thanks for sharing always informative contents with us.


    Secure Assignment Help

  35. Anonymous

    Firstly I thankful to an author for sharing this very helpful post with us about Building Mutations with the SDK with the code.

    Emily Brown,

  36. Anonymous

    enter Roku activation code and sanction your roku gadget. Contact for Support if standing up to any issue. Find support with game plan and exploring, find answers to record and charging questions, and make sense of how to use your Roku device.

  37. Anonymous

    Driving viewership to an unheard of level How to actuate or setup Roku com gadget?. We all realize that the Roku player accompanies some astounding highlights (Roku Activation Code).

  38. Anonymous

    Go to Roku page record enter Roku com association code appeared on Roku TV. My Roku com associate not working use new Roku code.

  39. Anonymous

    Do you want to set up hulu antivirus in your computer then click here for more details.

  40. Anonymous

    On the off chance that you need to reinstall office or fix it, you can reverify your item key on setup page and can download more established form of office

  41. Anonymous

    mcafee activate have without a doubt the course of action of highlights which can ensure your electronic on the web and isolated nearness of the getting ready contraptions, and it causes you secure it similarly as it can keep up the power of your PC.

  42. Anonymous

    Roku is a streaming device, which is a reasonable roku setup and other Set-up Box. Roku is a bundle of amusement, where client can stream for boundless motion appears, web arrangement, news, animation and a lot more projects.

  43. Anonymous

    To activate office setup you need to visit Sign in, create new account,

  44. Anonymous

    To get started Office 2019, 2016 and office 365 download or installation you must need valid 25 character product key,

  45. Anonymous

    Buildings serve several societal needs – primarily as shelter from the weather, security, living space, privacy, to store belongings, and to comfortably live and work.

  46. Anonymous

    It appears to be old hat to state it, however regularly we let things get lost in an outright flood. We invest an excessive amount of time considering them, a lot of vitality agonizing over them. You merit a housekeeper or home producer to make your life simpler. You merit proficient house keeping, or a committed servant. commercial cleaning company

  47. Anonymous

    In this situation, an organization can viably make its great name in the market by making its creation and business activities ecologically well disposed. <a href='ISO'>'>ISO 14001 Jalajil</a>

  48. Anonymous

    In this situation, an organization can viably make its great name in the market by making its creation and business activities ecologically well disposed. ISO 14001 Jalajil

  49. Anonymous

    To use Roku streaming Device user have to make the Roku Account or sign in to by giving the alphanumeric Roku actuation code. Roku is an entertainment stick which streams various channels, for example, amazon prime, Netflix, Hulu, ESPN all channels at one place. Steps to create online Roku account is very simple which are referenced here:

  50. Anonymous

    , one of more return protests likewise should be passed, to decide the substance to come back from the question. These arrival questions additionally execute the IDataSenderBuilder interface and characterize what ought to be returned. In contrast to inquiries, the reaction might be an article or it might be only a solitary scalar json esteem. Subsequently,

    <a href='Pay'>'>Pay To Do My Assignments</a>

  51. Anonymous

    <a href='Pay'>'>Pay Someone To Do My Project</a> GraphQLRequest, which is included as the solicitation for an endpoint. This procedure ought to be recognizable from questions. There are additionally assistant strategies from the WWClient class to decrease the multifaceted nature of layers.

  52. Anonymous

    خرید بلیط هواپیما با گسترش روز افزون استفاده از اینترنت دچار تحولات زیادی شده است به طوری که امروزه بلیط هواپیما به مقاصد مختلف را می توان به صورت اینترنتی خریداری کرد. این روش دارای مزایای زیادی است که موجب می شود متقاضیان زیادی از این روش به صورت گسترده و روز افزون استفاده کنند. صرفه جویی در زمان و هزینه، سرعت و جابجایی در سفرهای بین شهری مسافران، باعث شده تا متقاضیان زیادی از روش خرید اینترنتی بلیط هواپیما استفاده نمایند. حق انتخاب گسترده تر مسافران یکی دیگر از مزایای استفاده از اینترنت در به دست آوردن بلیط دلخواه می باشد. با مراجعه به سایت تیک بان می توانید انواع بلیط هواپیما را به مقاصد مختلف و با قیمت های ارزان و اقتصادی مشاهده کرده و بهترین گزینه را رزرو کنید. - خرید بلیط هواپیما تیک بان - خرید بلیط اتوبوس - خرید بلیط قطار - چارتر

  53. Anonymous

    homework help for college students  Data Sender Builder interface, Input Data  Sender Builder. Most mutations expect objects, so take an Input Data Sender Builder. This is a Java object containing the mutation Name and the fields Map, a Map of field keys and values which contains the content being passed.

  54. Anonymous

    Finally, and when you have your design ready with the colors and shape that you like the most, use the lacquer to fix the paint so that it will not crack or crack. This will make your work last and not lose quality.

  55. Anonymous

    <a href=''>The Best Homework Writing Services</a> the result container and get an UpdateSpaceContainer which will contain the Space and an array of the member ids changed. could be reduced into a single line by using a helper method.

  56. Anonymous

    Tired from countless assignments? With this reliable writing service you can get a full happy student's set: free time, good grades, quality writing, more sleep, and no more worries. AS professional writers can support you with any paper you need. 

  57. Anonymous

    A great solution for building mutations with the SDK. Useful for an assignment expert who using this to solve programming assignments of students.

  58. Anonymous

    It is important to seek statistics coursework writing services and statistics essay writing services since students find help when they visit Business Statistics Writing Services

  59. Anonymous


    Hello, I would like to thank you for sharing this useful material. The information you have mentioned here will be useful. I would like to share with you all one useful which might be interesting for you as well.

  60. Anonymous

    Extremely wonderful blog site and short articles. I am really very delighted to visit your blog site. Now I am discovered which I really want. I check your blog site every day and also try to learn something from your blog site. Your article is amazing and your content quality is too good. This article is very helpful for me. you are a good choice for the topic. I am impressed with your writing skills. You improve your writing skill and become a good writer.

    if you are interested to watch the movies and songs, So you can visit our site and use the Roku device and enjoy Ultra HD 4K video quality.

  61. Anonymous

    the engineering for a transformation is to pass in an info item and at least one return objects to characterize what information an effective change should return. Cheap Assignment Writing Service

  62. Anonymous

    What's more, one of more return protests likewise should be passed, to decide the substance to get back from the inquiry. Law essay writing help

  63. Anonymous

    The best outfits for your ideal wintetrs. this site has all what you need.YOU need to visit this site to pick the best covers. tv series outfits

  64. Anonymous

    Thank you for sharing such professional recommendations. In this form, I even found the answer to the question of how to write a good music review, it is very convenient to receive such advice.

  65. Anonymous

    alprostadil use after heart surgery alprostadil 250mcg urethral supp
  66. Anonymous

    sildenafil 50 mg canada sildenafil 2.5
  67. Anonymous

    shreedama technologies worked on a large number of local <a href="">applications for Android</a>. We are expertise in android app development with all kinds of integration and app developments. <a href=""> IT company</a> is the best app development company in surat.

  68. Anonymous

    This is very useful content and through this, we can get important information about SDK and get benefits. Many beginners can solve their issues with the help of this content. Affordable dissertation writing UK

Write a comment…