Project created by template contain invalid types - apollo-fullstack-react-mongo-ts
kresli opened this issue · comments
npx create-graphback graphql-test
- pick
apollo-fullstack-react-mongo-ts
cd graphql-test && yarn && yarn generate
cd client && yarn && yarn generate
client/src/generated-types.tsx
is generated with following types
export type FindCommentsQuery = (
{ __typename?: 'Query' }
& { findComments: (
{ __typename?: 'CommentResultList' }
& Pick<CommentResultList, '[object Object]' | '[object Object]' | '[object Object]'>
& { items: Array<Maybe<(
{ __typename?: 'Comment' }
& CommentExpandedFieldsFragment
)>> }
) }
);
Automatically generated comment to notify maintainers
/cc @craicoverflow, @machi1990, @wtrocki
Thanks for raising this issue @kresli! This looks to me like an issue with graphql-code-generator.
I tried this out and then updated these dependencies and now it works. If you do the same it should work:
"@graphql-cli/codegen": "1.17.14",
"@graphql-codegen/add": "2.0.1",
"@graphql-codegen/typescript": "1.17.11",
"@graphql-codegen/typescript-operations": "1.17.10",
"@graphql-codegen/typescript-react-apollo": "2.1.1",
shall I open a new issue there?
No need - they appear to have fixed this issue already, so if you try updating your dependencies it should work. Come back to me if it does not though