1
I have a sveltekit + apollo graphql project here. introspecting from my dev-env api here.
The issue I’m having is the codegen with this config:
import type { CodegenConfig } from '@graphql-codegen/cli';
const config: CodegenConfig = {
schema: '<<<url>>>',
documents: './src/lib/graphql-service/**/*.gql',
generates: {
'./src/lib/graphql-service/generated.ts': {
plugins: ['typescript', 'typescript-operations', 'graphql-codegen-svelte-apollo']
}
},
watch: false
};
export default config;
is only generating watchQuery type of queries.
Example of generated query:
export const Me = (
options: Omit<WatchQueryOptions<MeQueryVariables>, 'query'>
): Readable<
ApolloQueryResult<MeQuery> & {
query: ObservableQuery<MeQuery, MeQueryVariables>;
}
> => {
const q = client.watchQuery({
query: MeDoc,
...options
});
var result = readable<
ApolloQueryResult<MeQuery> & {
query: ObservableQuery<MeQuery, MeQueryVariables>;
}
>({ data: {} as any, loading: true, error: undefined, networkStatus: 1, query: q }, (set) => {
q.subscribe((v: any) => {
set({ ...v, query: q });
});
});
return result;
I can’t seem to find anything around the docs or example projects around how this whole thing could be altered, if at all?
|