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

Tighter context typing for GraphQLServerOptions #919

Merged

Conversation

majelbstoat
Copy link
Contributor

@majelbstoat majelbstoat commented Mar 28, 2018

This small patch adds optional support for tighter typing on the context of GraphQLServerOptions, to match the equivalent ones in graphql-tools. There's still a gap as GraphQLSchemaConfig, GraphQLObjectType and getFields are all still typed as any, but it at least allows a demonstration of consistency between the resolvers passed to makeExecutableSchema and the context that will be supplied by parameterising them both with a common type. The param defaults to any and is backwards compatible.

TODO:

  • Update CHANGELOG.md with your change (include reference to issue & this PR)
  • Make sure all of the significant new logic is covered by tests
  • Rebase your changes on master so that they can be merged easily
  • Make sure all tests and linter rules pass

/label types

@apollo-cla
Copy link

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

@ghost ghost added types labels Mar 28, 2018
@abernix
Copy link
Member

abernix commented Mar 28, 2018

Sorry, apparently CircleCI wasn't setup to build PRs from Git forks. I think I've fixed it. Could perform either of the following?:

  • Push an empty commit to this branch (to be squashed out later):
    git commit --allow-empty -m "empty commit" && git push origin jamie/graphql-option-context; or
  • Amend the commit so it gets a new hash, then force push to this PR branch (should be safe, as it's a PR branch!):
    git commit --amend --no-edit && git push --force origin jamie/graphql-option-context

(Both of these assume that your origin remote is https://github.com/majelbstoat/apollo-server).

@abernix abernix self-assigned this Apr 4, 2018
@abernix abernix merged commit f387a1c into apollographql:master Apr 18, 2018
abernix added a commit that referenced this pull request Apr 18, 2018
@abernix
Copy link
Member

abernix commented Apr 18, 2018

Thanks so much, @majelbstoat.

@abernix
Copy link
Member

abernix commented Apr 18, 2018

This should be published in 1.3.5. Please report back how it works!

@majelbstoat
Copy link
Contributor Author

Works great, thanks! :)

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.

None yet

3 participants