#here s the request

1 messages · Page 1 of 1 (latest)

runic atlas
sick kayakBOT
#

Hi @runic atlas. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

runic atlas
#

did it work before or are you still working on it?

sick kayakBOT
#

Sorry @runic atlas, I seem to be having a bit of trouble. Don't worry though, I've pinged my supprt and they will try to fix me up! :technologist:

Perhaps try again in 15mins?

runic atlas
#

piss off bot

left solstice
#

generated file just never gets updates and documents is always = []

#

types work just fine tho

left solstice
#

heres my config

import type { CodegenConfig } from '@graphql-codegen/cli'

const url = process.env.STRAPI_API_URL as string;
const xApiKey = process.env.STRAPI_API_KEY as string;

const config: CodegenConfig = {
   // schema: [
   //    {
   //       [url]: {
   //          headers: {
   //             "x-api-key": xApiKey,
   //          },
   //       },
   //    },
   // ],
   schema: url,
   documents: ["app/**/*.{ts, tsx}", "app/*.{ts, tsx}"],
   ignoreNoDocuments: true,
   generates: {
      "./gql/": {
         preset: "client",
         plugins: [],
      },
   },
};

export default config
runic atlas
#

do you receive any error or something?

#

tbh i have no idea what is wrong

left solstice
#

same X_X

left solstice
runic atlas
#

i know nextjs has an example repo with graphql an stuff

runic atlas
#

like what error?

left solstice
runic atlas
#

ah yea like that

left solstice
runic atlas
left solstice
#

yeah, no problem there, updates types perfectly fine, just the queries that stay empty, i.e. gql never gets updated and documents always stay = []

runic atlas
#

weird

#

is the code opensource by any chance?

left solstice
#

nah, internal stuff X_X

runic atlas
#

sorry dude

#

i really have no idea

left solstice
#

its ok, hopefully someone else wanders in:D

#

thanks for this tho, helps to talks it out at least

runic atlas
#

just wondering what is the contents of '../../gql/gql' is that the codegen script?

left solstice
#

what it generates by default

/* eslint-disable */
import * as types from './graphql';
import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core';

const documents = [];
/**
 * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
 *
 *
 * @example
 * ``ts
 * const query = graphql(`query GetUser($id: ID!) { user(id: $id) { name } }`);
 * ``
 *
 * The query argument is unknown!
 * Please regenerate the types.
 */
export function graphql(source: string): unknown;

export function graphql(source: string) {
  return (documents as any)[source] ?? {};
}

export type DocumentType<TDocumentNode extends DocumentNode<any, any>> = TDocumentNode extends DocumentNode<  infer TType,  any>  ? TType  : never;