-
Notifications
You must be signed in to change notification settings - Fork 269
Closed
Description
Hi! I just added @apollo/federation 0.21.2
as a dependency in my project and get the following TS error:
node_modules/@apollo/federation/dist/types.d.ts:3:35 - error TS2707: Generic type 'GraphQLObjectType<TSource, TContext>' requires between 0 and 2 type arguments.
3 export declare const ServiceType: GraphQLObjectType<any, any, {
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4 [key: string]: any;
~~~~~~~~~~~~~~~~~~~~~~~
5 }>;
~~
I checked out @apollo/federation master and ran npm run compile
with an additional compiler option "declaration": true
in tsconfig.build.json
an this results in a correct dist/types.d.ts
:
import { GraphQLFieldConfig, GraphQLUnionType, GraphQLObjectType, GraphQLScalarType, GraphQLType, GraphQLNamedType, GraphQLResolveInfo } from 'graphql';
export declare const EntityType: GraphQLUnionType;
export declare const ServiceType: GraphQLObjectType<any, any>; // <-- ONLY 2 TYPE PARAMETERS
export declare const AnyType: GraphQLScalarType;
export declare type GraphQLReferenceResolver<TContext> = (reference: object, context: TContext, info: GraphQLResolveInfo) => any;
declare module 'graphql/type/definition' {
interface GraphQLObjectType {
resolveReference?: GraphQLReferenceResolver<any>;
}
interface GraphQLObjectTypeConfig<TSource, TContext> {
resolveReference?: GraphQLReferenceResolver<TContext>;
}
}
export declare const entitiesField: GraphQLFieldConfig<any, any>;
export declare const serviceField: GraphQLFieldConfig<any, any>;
export declare const federationTypes: GraphQLNamedType[];
export declare function isFederationType(type: GraphQLType): boolean;
//# sourceMappingURL=types.d.ts.map
Other Dependencies in the Project
"typescript": "^4.2.2",
"graphql": "^15.5.0",
"apollo-server-core": "^2.21.0",
ovstackelberg and kpbode
Metadata
Metadata
Assignees
Labels
No labels