Questions tagged [graphql]

GraphQL is an API technology designed to describe the complex, nested data dependencies of modern web applications. It is often considered an alternative to SOAP or REST

GraphQL is a query language for APIs and a runtime for fulfilling those queries with your existing data. GraphQL provides a complete and understandable description of the data in your API, gives clients the power to ask for exactly what they need and nothing more, makes it easier to evolve APIs over time, and enables powerful developer tools.

There are GraphQL implementations in almost every server-side language, and powerful clients for most UI platforms.

20808 questions
350
votes
6 answers

How to query all the GraphQL type fields without writing a long query?

Assume you have a GraphQL type and it includes many fields. How to query all the fields without writing down a long query that includes the names of all the fields? For example, If I have these fields : public function fields() { return…
BlackSigma
  • 3,505
  • 2
  • 15
  • 8
269
votes
9 answers

When and How to use GraphQL with microservice architecture

I'm trying to understand where GraphQL is most suitable to use within a microservice architecture. There is some debate about having only 1 GraphQL schema that works as API Gateway proxying the request to the targeted microservices and coercing…
Fabrizio Fenoglio
  • 5,767
  • 14
  • 38
  • 75
248
votes
12 answers

Nodemon Error: "System limit for number of file watchers reached"

I'm learning GraphQL and am using prisma-binding for GraphQL operations. I'm facing this nodemon error while I'm starting my Node.js server and its giving me the path of schema file which is auto generated by a graphql-cli. What is this error all…
Rehan Sattar
  • 3,497
  • 4
  • 13
  • 21
202
votes
4 answers

How to properly make mock throw an error in Jest?

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…
Le garcon
  • 7,197
  • 9
  • 31
  • 46
179
votes
6 answers

What is the difference between Falcor and GraphQL?

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…
Gajus
  • 69,002
  • 70
  • 275
  • 438
177
votes
2 answers

In GraphQL what's the meaning of "edges" and "node"?

I am consuming a GraphQL endpoint and I get results that contain edges and node tags. I am supplying a clean JSON structure for my query, so this doesn't make sense to me. It seems as if the GraphQL server is polluting my data with no obvious…
Ska
  • 6,658
  • 14
  • 53
  • 74
176
votes
4 answers

What's the point of input type in GraphQL?

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:…
Dmitrii Dushkin
  • 3,070
  • 4
  • 26
  • 37
139
votes
3 answers

What is an exclamation point in GraphQL?

In a schema file that I have I noticed there are exclamation marks after some types, like # Information on an account relationship type AccountEdge { cursor: String! node: Account! } What do these mean? I can't find anything about it in the…
JuanCaicedo
  • 3,132
  • 2
  • 14
  • 36
126
votes
6 answers

Are there any disadvantages to GraphQL?

All the articles about GraphQL will tell you how wonderful it is, but are there any disadvantages or shortcomings to it? Thank you.
Dr.Nemo
  • 1,451
  • 2
  • 11
  • 15
123
votes
14 answers

Get GraphQL whole schema query

I want to get the schema from the server. I can get all entities with the types but I'm unable to get the properties. Getting all types: query { __schema { queryType { fields { name type { kind ofType…
Aleksandrenko
  • 2,987
  • 6
  • 28
  • 34
96
votes
10 answers

GraphQL Expected Iterable, but did not find one for field xxx.yyy

I'm currently trying GraphQL with NodeJS and I don't know, why this error occurs with the following query: { library{ name, user { name email } } } I am not sure if the type of my resolveLibrary is right, because at any…
Vetterjack
  • 2,227
  • 4
  • 19
  • 31
95
votes
6 answers

Can graphql return aggregate counts?

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?
orbital
  • 943
  • 3
  • 16
  • 28
92
votes
5 answers

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

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…
angrykoala
  • 3,774
  • 6
  • 30
  • 55
92
votes
1 answer

what's the difference between parseValue and parseLiteral in GraphQLScalarType

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. http://graphql.org/graphql-js/type/#graphqlscalartype The…
MonkeyBonkey
  • 46,433
  • 78
  • 254
  • 460
90
votes
14 answers

How to send graphql query by postman?

I use POST type URL http://######/graphql Body: query: "query: "{'noteTypes': {'name', 'label', 'labelColor', 'groupName', 'groupLabel', 'imageUrl'}}" But it return "message": "Must provide query string."
ZPPP
  • 1,567
  • 2
  • 18
  • 27
1
2 3
99 100