graphql-codegenを実行するとgql.tsがエラーになる
graphql-codegen
を実行するとgql.ts
で下記のようなエラーが発生しました。
Variable 'documents' implicitly has type 'any[]' in some locations where its type cannot be determined.
codegen.ts
のdocuments
に指定しているファイルに以下のようなクエリを記述します。
そして、graphql-codegen
を実行すると、エラーが消えます。
const GET_CARS = gql(/* GraphQL */ `
query findCars {
cars {
name
price
user {
name
}
}
}`);