aerogear / graphback

Graphback - Out of the box GraphQL server and client

Home Page:https://graphback.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

kresli opened this issue · comments

  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
    )>> }
  ) }
);

Automatically generated comment to notify maintainers
/cc @craicoverflow, @machi1990, @wtrocki

commented

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?

commented

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 👍