Skip to content

Tighter context typing for GraphQLServerOptions#919

Merged
abernix merged 2 commits into
apollographql:masterfrom
majelbstoat:jamie/graphql-option-context
Apr 18, 2018
Merged

Tighter context typing for GraphQLServerOptions#919
abernix merged 2 commits into
apollographql:masterfrom
majelbstoat:jamie/graphql-option-context

Conversation

@majelbstoat

@majelbstoat majelbstoat commented Mar 28, 2018

Copy link
Copy Markdown
Contributor

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
Copy Markdown

@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

abernix commented Mar 28, 2018

Copy link
Copy Markdown
Member

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).

@majelbstoat majelbstoat force-pushed the jamie/graphql-option-context branch from 3e0e465 to c6ac66d Compare March 28, 2018 20:43
@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

abernix commented Apr 18, 2018

Copy link
Copy Markdown
Member

Thanks so much, @majelbstoat.

@abernix

abernix commented Apr 18, 2018

Copy link
Copy Markdown
Member

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

@majelbstoat

Copy link
Copy Markdown
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.

3 participants