I'm using Apollo Client with React, graphql-tag loaded with Webpack, and graphql-config to maintain the schema on the client.
There is a file ./myclient/src/features/stats/graphql/getStart.graphql
query GetStart {
start @client
}
where start
and @client
don't validate with the IDE graphql plugin because they are not included in the auto generated schema.
The ./myclient/.graphqlconfig
file
{
"projects": {
"client": {
"schemaPath": "schema.graphql",
"extensions": {
"endpoints": {
"dev": "http://localhost:3000/graphql"
}
}
}
}
}
Webpack is configured to load the graphql schema on the client with
{
test: /\.(graphql|gql)$/,
exclude: /node_modules/,
use: 'graphql-tag/loader',
},
It will load the server schema correctly. But, how do I configure it to validate or ignore the start @client
which is causing Unknown field "start" on object "Query"
and Unknown directive "@client"
errors?