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

Improve the docs about "modules" when initialize ApolloServer #4386

Closed
mrdulin opened this issue Jul 16, 2020 · 2 comments
Closed

Improve the docs about "modules" when initialize ApolloServer #4386

mrdulin opened this issue Jul 16, 2020 · 2 comments
Labels
📝 documentation Focuses on changes to the documentation (docs)

Comments

@mrdulin
Copy link

mrdulin commented Jul 16, 2020

Don't find any doc about "modules" config. Code here:
server.ts:

import { ApolloServer } from 'apollo-server';
import { Post, Tag } from './modules';

const server = new ApolloServer({
  modules: [Post, Tag],
  playground: true,
  introspection: true,
});

server.listen().then(({ url }) => {
  console.log(`apollo server is listening on ${url}`);
});

types.ts:

export interface Config extends BaseConfig {
  modules?: GraphQLSchemaModule[];
  // ...
}

Please add a doc and usage for it. I create a minimal example, but it doesn't work. Got error:

Type "Query" was defined more than once.

repo: https://github.com/mrdulin/apollo-graphql-tutorial/tree/master/src/initialize-with-modules

@justinmchase
Copy link

You have to extend a type that appears in multiple modules.

extend type Query {
  posts: [Post]!
}
extend type Query {
  tags: [Tag]!
}

@abernix abernix added the 📝 documentation Focuses on changes to the documentation (docs) label Dec 31, 2020
@glasser
Copy link
Member

glasser commented Oct 21, 2022

Duplicate of #3642

@glasser glasser marked this as a duplicate of #3642 Oct 21, 2022
@glasser glasser closed this as not planned Won't fix, can't repro, duplicate, stale Oct 21, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
📝 documentation Focuses on changes to the documentation (docs)
Projects
None yet
Development

No branches or pull requests

4 participants