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.

14791 questions
216
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
  • 4,899
  • 13
  • 34
  • 69
182
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
  • 1,825
  • 2
  • 12
  • 7
172
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
  • 55,791
  • 58
  • 236
  • 384
147
votes
8 answers

Nodemon Error: System limit for number of file watchers reached

I'm learning graphql and using prisma-binding for graphql operations. I'm facing this nodemon error while I'm starting my node server and its giving me the path of schema file which is auto generated by a graphql-cli. Can anyone tell me what this…
Rehan Sattar
  • 1,996
  • 2
  • 9
  • 18
118
votes
1 answer

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

I am consuming a particular GraphQL endpoint and although I am supplying a clean JSON structure as a query, when I get the results I get "edges" and "node" tags. It seems as if it is polluting my data with no obvious benefit. Why is it there and is…
Ska
  • 5,481
  • 9
  • 47
  • 67
108
votes
2 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:…
Dmitry Dushkin
  • 2,271
  • 4
  • 22
  • 36
108
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,249
  • 2
  • 9
  • 13
91
votes
2 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
  • 3,929
  • 5
  • 23
  • 38
86
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,499
  • 2
  • 14
  • 25
82
votes
2 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
  • 2,272
  • 1
  • 10
  • 26
77
votes
5 answers

Firebase & GraphQL

Does anyone have any experience with GraphQL and Firebase? I figure one would place the firebase calls in the resolver of the relevant field, passing some variable from the props of the component into the arguments of the query. How can we insert…
omgj
  • 1,249
  • 2
  • 11
  • 16
77
votes
11 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,353
  • 4
  • 23
  • 33
72
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
  • 40,521
  • 63
  • 217
  • 426
68
votes
3 answers

How do I add a description to a field in "GraphQL schema language"

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?
derekdreery
  • 3,280
  • 4
  • 27
  • 38
67
votes
5 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
  • 1,519
  • 3
  • 13
  • 22
1
2 3
99 100