Skip to content
Discussion options

You must be logged in to vote

Hi @charlypoly, thanks for the advice. However, with my current setup I'm already generating the GetProductsDocument. My issue was I was importing the wrong thing from the generated file, instead of GetProductsQueryResult it should have been GetProductsQuery

So for example this instead:

// ...
import type { GetProductsQuery } from 'yadayada/generated/graphql';
import { GetProductsDocument } from 'yadayada/generated/graphql';

export const getStaticProps = async () => {
  const client = ApolloClient();

  const { data } = await client.query<GetProductsQuery>({
    query: GetProductsDocument,
    variables: {
      limit: PRODUCTS_PAGE_LIMIT,
    },
  });
  // ...
}

Now there errors are gone 🎉

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by captDaylight
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants