Questions

  • What’s the point of input type in GraphQL?

    165 Could you please explain why if input argument of mutation is object it should be input type? I think much simpler just reuse type without providing id. For example: type Sample { id: String name: String } input SampleInput { name: String } type RootMutation { addSample(sample: Sample): Sample # <– instead of it […]

  • How to properly make mock throw an error in Jest?

    176 I’m testing my GraphQL api using Jest. I’m using a separate test suit for each query/mutation I have 2 tests (each one in a separate test suit) where I mock one function (namely, Meteor’s callMethod) that is used in mutations. it(‘should throw error if email not found’, async () => { callMethod .mockReturnValue(new Error(‘User […]

  • Modifying Response of Graphql before sent out

    2 I am looking for a way to modify the response object of a graphql query or mutation before it gets sent out. Basically in addition the the data object, I want to have extra fields like code and message. At the moment I am solving this by adding the fields directly into my GQL […]

  • Is it possible to not return any data when using a GraphQL mutation?

    86 I have several GraphQL queries and mutations, now I’m trying to implement a delete mutation without returning any data: type Mutation{ addElement(element: ElementData): ID removeElement(id: ID): ┬┐? } However, it seems to be required to have a return value for the delete operation. Is there a way to perform an “empty” response in GraphQL? […]

  • Can graphql return aggregate counts?

    85 Graphql is great and I’ve started using it in my app. I have a page that displays summary information and I need graphql to return aggregate counts? Can this be done? graphql Share Improve this question Follow asked Dec 16, 2015 at 20:38 orbitalorbital 82333 gold badges1616 silver badges2828 bronze badges Add a comment […]

  • How to send graphql query by postman?

    90 I use POST type URL https://######/graphql Body: query: “query: “{‘noteTypes’: {‘name’, ‘label’, ‘labelColor’, ‘groupName’, ‘groupLabel’, ‘imageUrl’}}” But it return “message”: “Must provide query string.” graphql postman Share Improve this question Follow edited Jun 13, 2018 at 4:48 Neeraj Wadhwa 62522 gold badges77 silver badges1818 bronze badges asked Feb 28, 2017 at 23:32 ZPPPZPPP 1,54922 […]

  • Are there any disadvantages to GraphQL? [closed]

    122 Closed. This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 3 years ago. Improve this question All the articles about GraphQL will tell you how wonderful it is, but are there […]

  • what’s the difference between parseValue and parseLiteral in GraphQLScalarType

    91 Looking through the GraphQL documentation for custom scalar types (I’m trying to create my own date type) I’m not sure what the difference between parseValue and parseLiteral are. https://graphql.org/graphql-js/type/#graphqlscalartype The documentation doesn’t seem to include any descriptions of what the functions are supposed to do. Can someone let me know what the requirements are? […]

  • How do I add a description to a field in “GraphQL schema language”

    85 I have a graphql schema, a fragment of which looks like this: type User { username: String! password: String! } In graphiql, there is a description field, but it always says “self-descriptive”. How do I add descriptions to the schema? javascript graphql apollo-server Share Follow asked Oct 10, 2016 at 16:37 derekdreeryderekdreery 3,80044 gold […]

  • What is the difference between Falcor and GraphQL?

    176 GraphQL consists of a type system, query language and execution semantics, static validation, and type introspection, each outlined below. To guide you through each of these components, we’ve written an example designed to illustrate the various pieces of GraphQL. – https://github.com/facebook/graphql Falcor lets you represent all your remote data sources as a single domain […]

1 364 365 366