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

Update the ApolloServer resolvers argument documentation #4426

Closed
wants to merge 4 commits into from

Conversation

mdawar
Copy link

@mdawar mdawar commented Jul 29, 2020

Updated the documentation of the resolvers argument of the ApolloServer constructor and the makeExecutableSchema function, added a note that the resolvers argument may be a single resolver map or an array of resolver maps with an example.

const authorResolvers = {
  Query: {
    authors() {
      return authors;
    }
  },
};

const bookResolvers = {
  Query: {
    books() {
      return books;
    }
  },
};

new ApolloServer({
  typeDefs,
  // The resolver map objects are deeply merged
  resolvers: [authorResolvers, bookResolvers],
});

The `resolvers ` argument may also be an array of resolver maps.
@apollo-cla
Copy link

@mdawar: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Apollo Contributor License Agreement here: https://contribute.apollographql.com/

StephenBarlow pushed a commit that referenced this pull request Sep 2, 2020
glasser pushed a commit that referenced this pull request Sep 11, 2020
glasser pushed a commit that referenced this pull request Sep 11, 2020
glasser pushed a commit that referenced this pull request Sep 11, 2020
glasser pushed a commit that referenced this pull request Sep 14, 2020
abernix added a commit that referenced this pull request Sep 15, 2020
* Content-complete on ApolloServer constructor and EngineReportingOptions updates
* Fix some broken links
* Fix some broken headers
* Incorporate #4426 change and merge segmented tables
* Use HTML-md-hybrid table to enable custom styles
* Use new API reference front matter and update some headers
* Use two-column field table layout
* Intentionally leave old EngineReportingOptions format,
  for more optimal formatting, since it's going away soon anyway.
* Put experimental AS constructor option in its own table
* Re-apply lost Fastify context signature changes (from #3895)
* Re-apply lost spelling correction (from #4473)

Co-authored-by: Stephen Barlow <[email protected]>
Co-authored-by: Jesse Rosenberger <[email protected]>
@StephenBarlow
Copy link
Contributor

Thanks for the PR @mdawar! This API reference received an overhaul recently, and the array option for this argument is now reflected: https://www.apollographql.com/docs/apollo-server/api/apollo-server/#resolvers

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants