Graphback: Project created by template contain invalid types - apollo-fullstack-react-mongo-ts

Created on 18 Nov 2020  路  4Comments  路  Source: aerogear/graphback

  1. npx create-graphback graphql-test
  2. pick apollo-fullstack-react-mongo-ts
  3. cd graphql-test && yarn && yarn generate
  4. 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
    )>> }
  ) }
);
bug templates database mongodb triage

Most helpful comment

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",

All 4 comments

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 :+1:

Was this page helpful?
0 / 5 - 0 ratings