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