Closed tianyingchun closed 4 months ago
we can via multiple plugins:
"plugins": [ { "name": "@0no-co/graphqlsp", "schema": "http://localhost:9001/shop-api", "tadaOutputLocation": "./e2e/graphql/graphql-shop-env.d.ts" }, { "name": "@0no-co/graphqlsp", "schema": "http://localhost:9001/admin-api", "tadaOutputLocation": "./e2e/graphql/graphql-admin-env.d.ts" } ]
it will correct generated graphql-shop-env.d.ts and graphql-admin-env.d.ts
graphql-shop-env.d.ts
graphql-admin-env.d.ts
but cause of each -env.d.ts have the same declare module will typings merge via interface setupSchema
-env.d.ts
interface setupSchema
declare module 'gql.tada' { interface setupSchema { introspection: introspection } }
if we want to create two individual grapql
import { initGraphQLTada } from '@semic/testing'; import type { introspection } from './graphql-admin-env.js'; export const graphql = initGraphQLTada<{ introspection: introspection; }>();
import { initGraphQLTada } from '@semic/testing'; import type { introspection } from './graphql-shop-env.js'; export const graphql = initGraphQLTada<{ introspection: introspection; }>();
only one is valid it's conflict , how we can resolve this?
"gql.tada": "1.4.3",
Duplicate of https://github.com/0no-co/gql.tada/issues/190
Describe the bug
we can via multiple plugins:
it will correct generated
graphql-shop-env.d.ts
andgraphql-admin-env.d.ts
but cause of each
-env.d.ts
have the same declare module will typings merge viainterface setupSchema
if we want to create two individual grapql
only one is valid it's conflict , how we can resolve this?
Reproduction
gql.tada version
"gql.tada": "1.4.3",
Validations