-
Using graphql generator for apollo angular (https://the-guild.dev/graphql/codegen/plugins/typescript/typescript-apollo-angular) If I have named clients for example {
provide: APOLLO_NAMED_OPTIONS,
useFactory(httpLink: HttpLink): NamedOptions {
return {
default: {
cache: new InMemoryCache(),
link: httpLink.create({
uri: '/graphql',
}),
},
admin: {
cache: new InMemoryCache(),
link: httpLink.create({
uri: '/graphql/admin',
}),
},
};
},
deps: [HttpLink],
} how goes one instruct the generator to use client "default" therefore in below configurations how do configure which client to use based on above configurations generates: {
'./default/type.ts': {
plugins: ['typescript'],
config: {
addExplicitOverride: true
}
},
'./default': {
preset: 'near-operation-file',
presetConfig: { extension: '.type.ts', baseTypesPath: '~../../type' },
plugins: ['typescript-operations', 'typescript-apollo-angular'],
config:
{
withHooks: true,
addOperationExport: true,
addExplicitOverride: true,
},
},
} |
Beta Was this translation helpful? Give feedback.
Answered by
isawk
Jan 22, 2024
Replies: 1 comment
-
Found answer right after posting usage with additional parameters mutation operation($data: create_directus_users_input!){
graphql_operation (data: $data) @namedClient(name: "system") {
first_name
last_name
email
}
} usage with additional parameters mutation operation($data: create_directus_users_input!){
graphql_operation @namedClient(name: "system") {
first_name
last_name
email
}
} |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
isawk
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Found answer right after posting
https://the-guild.dev/graphql/codegen/plugins/typescript/typescript-apollo-angular#namedclient-directive
usage with additional parameters
usage with additional parameters