When I run the following command:
apollo client:codegen --target=typescript --config=./apollo.config.js --outputFlat=./graphql.queries.ts
→ Error initializing Apollo GraphQL project "MySchema": Error: Error in "Loading schema for Merged schema": Error: Unknown directive "client".
This is due to one of my queries containing the @client
directive:
query MyQuery {
someStuff @client {
value
}
}
On https://github.com/apollographql/apollo-tooling/issues/366 I found out I could specify a --clientSchema attribute to the apollo codegen command for instance:
apollo codegen:generate generated \
--queries=src/components/**/*.tsx \
--target typescript \
--schema src/generated/schema.json \
--clientSchema src/state/schema.graphql
But I am using an apollo.config.js
file and I do not find how to specify this clientSchema equivalent into the config file.
I see 2 possible errors:
- either I am not using the @client directive properly
- or there is a missing (removed or undocumented?) support for clientSchema in the apollo.config.js file
Any idea?