Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(typeDefs): allow Array<string | DocumentNode> #5978

Merged
merged 4 commits into from
Jan 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ The version headers in this history reflect the versions of Apollo Server itself

## vNEXT

- `apollo-server-core`: The `typeDefs`, `resolvers`, and `parseOptions` constructor arguments are passed directly through to `makeExecutableSchema` from `@graphql-tools/schema` if provided. Now their TypeScript type definitions come directly from that package so that any types accepted by that package can be provided. [PR #5978](https://github.com/apollographql/apollo-server/pull/5978)
- `apollo-server-fastify`: Drop dependency on `fast-json-stringify`. [PR #5988](https://github.com/apollographql/apollo-server/pull/5988)
- `apollo-server-azure-functions`: Update TypeScript types package `@azure/functions` from v1 to v3 and change it to a dev dependency. (We were advised to change it to a dev dependency [by the authors of the package](https://github.com/Azure/azure-functions-nodejs-worker/pull/467#issuecomment-967737890); if this turns out to be problematic we can revert this part of the change. They also do not believe this is a backwards-incompatible change despite the major version bump; this package does a major version bump when the underlying Azure Functions runtime has a major version bump.) [PR #5919](https://github.com/apollographql/apollo-server/pull/5919)

Expand Down
2 changes: 0 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion packages/apollo-server-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
"@apollographql/graphql-playground-html": "1.6.29",
"@graphql-tools/mock": "^8.1.2",
"@graphql-tools/schema": "^8.0.0",
"@graphql-tools/utils": "^8.0.0",
"@josephg/resolvable": "^1.0.0",
"apollo-datasource": "file:../apollo-datasource",
"apollo-reporting-protobuf": "file:../apollo-reporting-protobuf",
Expand Down
15 changes: 10 additions & 5 deletions packages/apollo-server-core/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { GraphQLSchema, DocumentNode, ParseOptions } from 'graphql';
import type { GraphQLSchema, DocumentNode } from 'graphql';
import type { IMocks } from '@graphql-tools/mock';
import type { IResolvers } from '@graphql-tools/utils';
import type { IExecutableSchemaDefinition } from '@graphql-tools/schema';
import type {
ApolloConfig,
ValueOrPromise,
Expand Down Expand Up @@ -89,9 +89,14 @@ export type DocumentStore = KeyValueCache<DocumentNode>;
// fields that are not specific to a single integration
export interface Config<ContextFunctionParams = any> extends BaseConfig {
modules?: GraphQLSchemaModule[];
typeDefs?: DocumentNode | Array<DocumentNode> | string | Array<string>;
parseOptions?: ParseOptions;
resolvers?: IResolvers | Array<IResolvers>;

// These three options are always only passed directly through to
// makeExecutableSchema. (If you don't want to use makeExecutableSchema, pass
// `schema` instead.)
typeDefs?: IExecutableSchemaDefinition['typeDefs'];
resolvers?: IExecutableSchemaDefinition['resolvers'];
parseOptions?: IExecutableSchemaDefinition['parseOptions'];

schema?: GraphQLSchema;
context?: Context | ContextFunction<ContextFunctionParams>;
introspection?: boolean;
Expand Down