Skip to content

Commit

Permalink
fix: schema definition included in schema-first approach
Browse files Browse the repository at this point in the history
  • Loading branch information
burn2delete committed Dec 21, 2023
1 parent c2e408f commit 9ee939f
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,8 @@ export interface IQuery {
foo(): Nullable<boolean> | Promise<Nullable<boolean>>;
}

export interface ISchema {
Query: IQuery;
}

type Nullable<T> = T | null;
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,8 @@ export class User {
posts?: Nullable<Nullable<Post>[]>;
}

export class ISchema {
Query: IQuery;
}

type Nullable<T> = T | null;
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,8 @@ export class User {
posts?: Nullable<Nullable<Post>[]>;
}

export class ISchema {
Query: IQuery;
}

type Nullable<T> = T | null;
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ export class GraphQLFederationDefinitionsFactory extends GraphQLDefinitionsFacto
// This leads to duplicated IQuery interfaces
// see: https://github.com//issues/2344
const mergedDefinition = mergeTypeDefs([printSubgraphSchema(schema)], {
useSchemaDefinition: false,
// schema-first requires the schema definition to be included for federation 2 @link to function
useSchemaDefinition: true,
throwOnConflict: true,
commentDescriptions: true,
reverseDirectives: true,
Expand Down

0 comments on commit 9ee939f

Please sign in to comment.