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

ApolloServer config mentions "cors" but it's not included in the type definition #1882

Closed
1 task done
kevinburke opened this issue Oct 26, 2018 · 2 comments
Closed
1 task done
Labels
🙏 help-wanted 📝 documentation Focuses on changes to the documentation (docs)
Milestone

Comments

@kevinburke
Copy link

  • docs

    Documentation issues should be labeled, but if you know the answer
    please consider submitting a Pull Request instead. (The documentation
    lives in the docs/source directory of this repository.)

The documentation for Apollo Server mentions it can accept cors as an argument to the ApolloServer constructor: https://www.apollographql.com/docs/apollo-server/api/apollo-server.html

cors: <Object | boolean> (apollo-server)

Pass the integration-specific CORS options. false removes the CORS middleware and true uses the defaults. This option is only available to apollo-server. For other server integrations, place cors inside of applyMiddleware.

However, the type definition for Config does not include a cors object:

export interface Config extends Pick<GraphQLOptions<Context<any>>, 'formatError' | 'debug' | 'rootValue' | 'validationRules' | 'formatResponse' | 'fieldResolver' | 'cacheControl' | 'tracing' | 'dataSources' | 'cache'> {
    typeDefs?: DocumentNode | Array<DocumentNode>;
    resolvers?: IResolvers;
    schema?: GraphQLSchema;
    schemaDirectives?: Record<string, typeof SchemaDirectiveVisitor>;
    context?: Context<any> | ContextFunction<any>;
    introspection?: boolean;
    mocks?: boolean | IMocks;
    mockEntireSchema?: boolean;
    engine?: boolean | EngineReportingOptions;
    extensions?: Array<() => GraphQLExtension>;
    persistedQueries?: PersistedQueryOptions | false;
    subscriptions?: Partial<SubscriptionServerOptions> | string | false;
    uploads?: boolean | FileUploadOptions;
    playground?: PlaygroundConfig;
}

Running apollo-server-core v2.1.0.

@ghost ghost added the 📝 documentation Focuses on changes to the documentation (docs) label Oct 26, 2018
@Can2Nya
Copy link

Can2Nya commented Feb 22, 2019

some problem,mark

@abernix
Copy link
Member

abernix commented Feb 26, 2019

This should be fixed thanks to @cheapsteak's #2330 and #2373. Thanks for reporting this!

@abernix abernix added this to the Release 2.4.x milestone Feb 26, 2019
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🙏 help-wanted 📝 documentation Focuses on changes to the documentation (docs)
Projects
None yet
Development

No branches or pull requests

4 participants