@pothos/plugin-federation
Version:
A Pothos plugin for implementing apollo federation subGraphs
542 lines • 17 kB
TypeScript
import './global-types';
import './schema-builder';
import { BasePlugin, type PothosEnumValueConfig, type PothosInputFieldConfig, type PothosOutputFieldConfig, type PothosTypeConfig, type SchemaTypes } from '@pothos/core';
export { hasResolvableKey } from './schema-builder';
export * from './types';
declare const pluginName = "federation";
export default pluginName;
export declare class PothosFederationPlugin<Types extends SchemaTypes> extends BasePlugin<Types> {
onTypeConfig(typeConfig: PothosTypeConfig): {
extensions: {
apollo: unknown;
directives: {
name: string;
args?: object;
}[];
} | {
apollo: unknown;
directives: {
name: string;
args?: object;
}[];
} | {
apollo: unknown;
directives: {
name: string;
args?: object;
}[];
} | {
apollo: unknown;
directives: {
name: string;
args?: object;
}[];
} | {
apollo: unknown;
directives: {
name: string;
args?: object;
}[];
} | {
apollo: unknown;
directives: {
name: string;
args?: object;
}[];
} | {
apollo: unknown;
directives: {
name: string;
args?: object;
}[];
} | {
apollo: unknown;
directives: {
name: string;
args?: object;
}[];
};
kind: "Mutation";
graphqlKind: "Object";
pothosOptions: PothosSchemaTypes.MutationTypeOptions;
isTypeOf?: import("graphql/jsutils/Maybe").Maybe<import("graphql").GraphQLIsTypeOfFn<unknown, object>>;
description?: import("graphql/jsutils/Maybe").Maybe<string>;
name: string;
astNode?: import("graphql/jsutils/Maybe").Maybe<import("graphql").ObjectTypeDefinitionNode>;
extensionASTNodes?: import("graphql/jsutils/Maybe").Maybe<readonly import("graphql").ObjectTypeExtensionNode[]>;
} | {
extensions: {
apollo: unknown;
directives: {
name: string;
args?: object;
}[];
} | {
apollo: unknown;
directives: {
name: string;
args?: object;
}[];
} | {
apollo: unknown;
directives: {
name: string;
args?: object;
}[];
} | {
apollo: unknown;
directives: {
name: string;
args?: object;
}[];
} | {
apollo: unknown;
directives: {
name: string;
args?: object;
}[];
} | {
apollo: unknown;
directives: {
name: string;
args?: object;
}[];
} | {
apollo: unknown;
directives: {
name: string;
args?: object;
}[];
} | {
apollo: unknown;
directives: {
name: string;
args?: object;
}[];
};
kind: "Object";
graphqlKind: "Object";
interfaces: import("@pothos/core").InterfaceParam<SchemaTypes>[];
pothosOptions: PothosSchemaTypes.ObjectTypeOptions;
isTypeOf?: import("graphql/jsutils/Maybe").Maybe<import("graphql").GraphQLIsTypeOfFn<unknown, object>>;
description?: import("graphql/jsutils/Maybe").Maybe<string>;
name: string;
astNode?: import("graphql/jsutils/Maybe").Maybe<import("graphql").ObjectTypeDefinitionNode>;
extensionASTNodes?: import("graphql/jsutils/Maybe").Maybe<readonly import("graphql").ObjectTypeExtensionNode[]>;
} | {
extensions: {
apollo: unknown;
directives: {
name: string;
args?: object;
}[];
} | {
apollo: unknown;
directives: {
name: string;
args?: object;
}[];
} | {
apollo: unknown;
directives: {
name: string;
args?: object;
}[];
} | {
apollo: unknown;
directives: {
name: string;
args?: object;
}[];
} | {
apollo: unknown;
directives: {
name: string;
args?: object;
}[];
} | {
apollo: unknown;
directives: {
name: string;
args?: object;
}[];
} | {
apollo: unknown;
directives: {
name: string;
args?: object;
}[];
} | {
apollo: unknown;
directives: {
name: string;
args?: object;
}[];
};
kind: "Query";
graphqlKind: "Object";
pothosOptions: PothosSchemaTypes.QueryTypeOptions;
isTypeOf?: import("graphql/jsutils/Maybe").Maybe<import("graphql").GraphQLIsTypeOfFn<unknown, object>>;
description?: import("graphql/jsutils/Maybe").Maybe<string>;
name: string;
astNode?: import("graphql/jsutils/Maybe").Maybe<import("graphql").ObjectTypeDefinitionNode>;
extensionASTNodes?: import("graphql/jsutils/Maybe").Maybe<readonly import("graphql").ObjectTypeExtensionNode[]>;
} | {
extensions: {
apollo: unknown;
directives: {
name: string;
args?: object;
}[];
} | {
apollo: unknown;
directives: {
name: string;
args?: object;
}[];
} | {
apollo: unknown;
directives: {
name: string;
args?: object;
}[];
} | {
apollo: unknown;
directives: {
name: string;
args?: object;
}[];
} | {
apollo: unknown;
directives: {
name: string;
args?: object;
}[];
} | {
apollo: unknown;
directives: {
name: string;
args?: object;
}[];
} | {
apollo: unknown;
directives: {
name: string;
args?: object;
}[];
} | {
apollo: unknown;
directives: {
name: string;
args?: object;
}[];
};
kind: "Subscription";
graphqlKind: "Object";
pothosOptions: PothosSchemaTypes.SubscriptionTypeOptions;
isTypeOf?: import("graphql/jsutils/Maybe").Maybe<import("graphql").GraphQLIsTypeOfFn<unknown, object>>;
description?: import("graphql/jsutils/Maybe").Maybe<string>;
name: string;
astNode?: import("graphql/jsutils/Maybe").Maybe<import("graphql").ObjectTypeDefinitionNode>;
extensionASTNodes?: import("graphql/jsutils/Maybe").Maybe<readonly import("graphql").ObjectTypeExtensionNode[]>;
} | {
extensions: {
apollo: unknown;
directives: {
name: string;
args?: object;
}[];
} | {
apollo: unknown;
directives: {
name: string;
args?: object;
}[];
} | {
apollo: unknown;
directives: {
name: string;
args?: object;
}[];
} | {
apollo: unknown;
directives: {
name: string;
args?: object;
}[];
} | {
apollo: unknown;
directives: {
name: string;
args?: object;
}[];
} | {
apollo: unknown;
directives: {
name: string;
args?: object;
}[];
} | {
apollo: unknown;
directives: {
name: string;
args?: object;
}[];
} | {
apollo: unknown;
directives: {
name: string;
args?: object;
}[];
};
kind: "Enum";
graphqlKind: "Enum";
pothosOptions: PothosSchemaTypes.EnumTypeOptions;
name: string;
description?: import("graphql/jsutils/Maybe").Maybe<string>;
values: import("graphql").ThunkObjMap<import("graphql").GraphQLEnumValueConfig>;
astNode?: import("graphql/jsutils/Maybe").Maybe<import("graphql").EnumTypeDefinitionNode>;
extensionASTNodes?: import("graphql/jsutils/Maybe").Maybe<ReadonlyArray<import("graphql").EnumTypeExtensionNode>>;
} | {
extensions: {
apollo: unknown;
directives: {
name: string;
args?: object;
}[];
} | {
apollo: unknown;
directives: {
name: string;
args?: object;
}[];
} | {
apollo: unknown;
directives: {
name: string;
args?: object;
}[];
} | {
apollo: unknown;
directives: {
name: string;
args?: object;
}[];
} | {
apollo: unknown;
directives: {
name: string;
args?: object;
}[];
} | {
apollo: unknown;
directives: {
name: string;
args?: object;
}[];
} | {
apollo: unknown;
directives: {
name: string;
args?: object;
}[];
} | {
apollo: unknown;
directives: {
name: string;
args?: object;
}[];
};
kind: "InputObject";
graphqlKind: "InputObject";
pothosOptions: PothosSchemaTypes.InputObjectTypeOptions;
description?: import("graphql/jsutils/Maybe").Maybe<string>;
name: string;
astNode?: import("graphql/jsutils/Maybe").Maybe<import("graphql").InputObjectTypeDefinitionNode>;
extensionASTNodes?: import("graphql/jsutils/Maybe").Maybe<readonly import("graphql").InputObjectTypeExtensionNode[]>;
isOneOf?: boolean | undefined;
} | {
extensions: {
apollo: unknown;
directives: {
name: string;
args?: object;
}[];
} | {
apollo: unknown;
directives: {
name: string;
args?: object;
}[];
} | {
apollo: unknown;
directives: {
name: string;
args?: object;
}[];
} | {
apollo: unknown;
directives: {
name: string;
args?: object;
}[];
} | {
apollo: unknown;
directives: {
name: string;
args?: object;
}[];
} | {
apollo: unknown;
directives: {
name: string;
args?: object;
}[];
} | {
apollo: unknown;
directives: {
name: string;
args?: object;
}[];
} | {
apollo: unknown;
directives: {
name: string;
args?: object;
}[];
};
kind: "Interface";
graphqlKind: "Interface";
interfaces: import("@pothos/core").InterfaceParam<SchemaTypes>[];
pothosOptions: PothosSchemaTypes.InterfaceTypeOptions;
description?: import("graphql/jsutils/Maybe").Maybe<string>;
name: string;
astNode?: import("graphql/jsutils/Maybe").Maybe<import("graphql").InterfaceTypeDefinitionNode>;
extensionASTNodes?: import("graphql/jsutils/Maybe").Maybe<readonly import("graphql").InterfaceTypeExtensionNode[]>;
resolveType?: import("graphql/jsutils/Maybe").Maybe<import("graphql").GraphQLTypeResolver<unknown, object>>;
} | {
extensions: {
apollo: unknown;
directives: {
name: string;
args?: object;
}[];
} | {
apollo: unknown;
directives: {
name: string;
args?: object;
}[];
} | {
apollo: unknown;
directives: {
name: string;
args?: object;
}[];
} | {
apollo: unknown;
directives: {
name: string;
args?: object;
}[];
} | {
apollo: unknown;
directives: {
name: string;
args?: object;
}[];
} | {
apollo: unknown;
directives: {
name: string;
args?: object;
}[];
} | {
apollo: unknown;
directives: {
name: string;
args?: object;
}[];
} | {
apollo: unknown;
directives: {
name: string;
args?: object;
}[];
};
kind: "Scalar";
graphqlKind: "Scalar";
pothosOptions: PothosSchemaTypes.ScalarTypeOptions;
name: string;
description?: import("graphql/jsutils/Maybe").Maybe<string>;
specifiedByURL?: import("graphql/jsutils/Maybe").Maybe<string>;
serialize?: import("graphql").GraphQLScalarSerializer<unknown> | undefined;
parseValue?: import("graphql").GraphQLScalarValueParser<unknown> | undefined;
parseLiteral?: import("graphql").GraphQLScalarLiteralParser<unknown> | undefined;
astNode?: import("graphql/jsutils/Maybe").Maybe<import("graphql").ScalarTypeDefinitionNode>;
extensionASTNodes?: import("graphql/jsutils/Maybe").Maybe<ReadonlyArray<import("graphql").ScalarTypeExtensionNode>>;
} | {
extensions: {
apollo: unknown;
directives: {
name: string;
args?: object;
}[];
} | {
apollo: unknown;
directives: {
name: string;
args?: object;
}[];
} | {
apollo: unknown;
directives: {
name: string;
args?: object;
}[];
} | {
apollo: unknown;
directives: {
name: string;
args?: object;
}[];
} | {
apollo: unknown;
directives: {
name: string;
args?: object;
}[];
} | {
apollo: unknown;
directives: {
name: string;
args?: object;
}[];
} | {
apollo: unknown;
directives: {
name: string;
args?: object;
}[];
} | {
apollo: unknown;
directives: {
name: string;
args?: object;
}[];
};
kind: "Union";
graphqlKind: "Union";
types: import("@pothos/core").ObjectParam<SchemaTypes>[];
pothosOptions: PothosSchemaTypes.UnionTypeOptions;
description?: import("graphql/jsutils/Maybe").Maybe<string>;
name: string;
astNode?: import("graphql/jsutils/Maybe").Maybe<import("graphql").UnionTypeDefinitionNode>;
extensionASTNodes?: import("graphql/jsutils/Maybe").Maybe<readonly import("graphql").UnionTypeExtensionNode[]>;
resolveType?: import("graphql/jsutils/Maybe").Maybe<import("graphql").GraphQLTypeResolver<unknown, object>>;
};
onOutputFieldConfig(fieldConfig: PothosOutputFieldConfig<Types>): PothosOutputFieldConfig<Types> | null;
onInputFieldConfig(fieldConfig: PothosInputFieldConfig<Types>): PothosInputFieldConfig<Types>;
onEnumValueConfig(valueConfig: PothosEnumValueConfig<Types>): PothosEnumValueConfig<Types>;
}
//# sourceMappingURL=index.d.ts.map