GraphQL - FDMediagroep/bnr-branded GitHub Wiki
How to query
A simple POST request with the GraphQL Query as body is everything you need to query a GraphQL Server. Examples here:
https://graphql.org/graphql-js/graphql-clients/
Example:
fetch('/graphql', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json',
},
body: JSON.stringify({query: "{ hello }"})
})
.then(r => r.json())
.then(data => console.log('data returned:', data));
data returned: Object { hello: "Hello world!" }
GraphQL config
https://graphql-config.com/ aims to standardize configuration for all GraphQL related tooling.
It recommends having all GraphQL related configuration in a file at the root of the project named .graphqlrc
.
Furthermore it specifies the format of this configuration file.
The official VSCode GraphQL plugin makes use of this configuration standard.
IDE GraphQL plugin
For autocomplete, syntax highlighting and inline query execution.
- Official VSCode GraphQL plugin
- 3rd party IntelliJ JS GraphQL plugin