Update upstream v1.6.0 - #8
Open
anufant21 wants to merge 96 commits into
Open
Conversation
Rename entryPoints to RootOperationTypes to align with specification terminology. see: https://spec.graphql.org/June2018/#sec-Root-Operation-Types
Co-authored-by: Sean Sorrell <me@seansorrell.org>
Float value of 0.0 is valid. Removed the incorrect if condition. Added a test. Fixes graph-gophers#546
* Added support of custom directives Co-authored-by: Vincent Composieux <vincent.composieux@gmail.com> Co-authored-by: Sean Sorrell <me@seansorrell.org> Co-authored-by: Pavel Nikolov <pavelnikolov@users.noreply.github.com> Co-authored-by: pavelnikolov <me@pavelnikolov.net>
Improve documentation and examples
Fix lint errors
…lvers Separate resolvers for each operation
…inistic-test Fix non-deterministic unit test
Improve comments
This helps to de-duplicate resolution logic across method vs field
resolvers, and helps prepare for changing the implementation of
field directive resolution by reducing the scope of that change.
Existing bugs in the implementation of directive resolution ('after'
only runs for fields which *cannot* return an error) are left
alone, as they'll be addressed when replacing the Before/After impl
with an alternative approach.
* Redesign Directive Resolvers The design of Directive field resolvers put burden on implementors of directives due to the use of the `types` package. Field resolvers which use receiver types and functions already have a more ergonomic design, which can be repeated here for directives. This simplifies and clarifies the implementation of directives for consumers, while putting the burden of validating types and arguments on the library. The implementation also incorrectly handled directive arguments declared in the SDL, which has been corrected. * Update Directive README example Reflect the changed directives API usage in the README * Add directives executable example Move directives example into main package Fix directives example Rename directives example file Return example file * Additional Directive Tests and Examples * Loosen Directive impl Type, allowing alternate visitors Allowing directives to not have to implement `ResolverInterceptor` in the future, so long as they implement a valid directive visitor function. This opens the path for directives which could execute validation prior to any resolving of fields, without also having to implement the resolver interceptor function. While this opens up the type, it is still validated when parsing the schema. When other functions like validation are supported, those will also be accepted. This approach avoids a 'no-op' function needing to be implemented, and the additional calls needing to be made unnecessarily when resolving fields in the schema. The names of types have also been updated, and types that don't need to be exposed have been removed * Rework directives again to return some safety Declaring an explicit interface that all directives must implement, with function `ImplementsDirective`. This is similar to implementing custom types, where the implementation returns `true` for the types it implements. This allows the schema option to replace the map with a varargs slice of directives, localising the knowledge of the name of the directive within the implementing type. * Update ImplementsDirective Don't allow directive visitors to implement multiple directives; they must only implement one, and return its name. This also allows the logic for applying directives to be adjusted to only loop through the visitors once, rather than once per directive declared on the schema * Ignore non-FIELD_DEFINITION directives For intercepting field resolution with directive visitors, ignore any directive location other than FIELD_DEFINITION for now. This is essential to continue to support other kinds of directives in the schema, even though directive visitors only implement handling of field definition currently. --------- Co-authored-by: pavelnikolov <pavel@section.io> Co-authored-by: Pavel Nikolov <pavelnikolov@users.noreply.github.com>
…alidation-error-ordering-for-directives Fix Flaky Order of Directive Validation
Schemas defined in the tests.json are highly dependent on the order that graphql-js tests register them. This results in re-ordering of the schemas and updates to many/all of the schema index values referring to them in tests when new schemas are inserted. Attempting to add some stability to the JSON for future changes here by sorting the schemas, and referring to them by a SHA id of the schema content, rather than index ordering. This results in a large change here but hopefully smaller changes when adding and updating test cases from graphql-js in the future.
…n-test-json Refactor Validation Tests JSON
Updating implementation of KnownArgumentNamesRule to follow the graphql-js test cases. Changes required here are to correct messaging and suggestions, along with pulling in the actual test cases. The minimum threshold is updated for the suggestion levenshteinDistance to allow suggestions for short names. From the test cases, this allows 'if' to be suggested when 'iff' is used with the @Skip directive.
…g-names-validation-rule Correctly apply arg names validation rule
Was missed from the previous commit, and resulting in failures due to its absence.
…function
Fix Missing Names Function
Enabling PossibleFragmentSpreadsRule tests, ensuring that behaviour is consistent with graphql-js. A minor issue where a failure should be reported by the FragmentsOnCompositeTypesRule rule instead is skipped, and can be addressed at a later point.
…gment-spreads-rule Apply PossibleFragmentSpreadsRule
Bumps [tar](https://github.com/isaacs/node-tar) from 6.1.13 to 6.2.1. - [Release notes](https://github.com/isaacs/node-tar/releases) - [Changelog](https://github.com/isaacs/node-tar/blob/main/CHANGELOG.md) - [Commits](isaacs/node-tar@v6.1.13...v6.2.1) --- updated-dependencies: - dependency-name: tar dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com>
…m_and_yarn/example/federation/integration/gateway/tar-6.2.1 Bump tar from 6.1.13 to 6.2.1 in /example/federation/integration/gateway
Bumps [ws](https://github.com/websockets/ws) from 7.5.9 to 7.5.10. - [Release notes](https://github.com/websockets/ws/releases) - [Commits](websockets/ws@7.5.9...7.5.10) --- updated-dependencies: - dependency-name: ws dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com>
…m_and_yarn/example/federation/integration/gateway/ws-7.5.10
Bumps [send](https://github.com/pillarjs/send) and [express](https://github.com/expressjs/express). These dependencies needed to be updated together. Updates `send` from 0.18.0 to 0.19.0 - [Release notes](https://github.com/pillarjs/send/releases) - [Changelog](https://github.com/pillarjs/send/blob/master/HISTORY.md) - [Commits](pillarjs/send@0.18.0...0.19.0) Updates `express` from 4.19.2 to 4.21.0 - [Release notes](https://github.com/expressjs/express/releases) - [Changelog](https://github.com/expressjs/express/blob/4.21.0/History.md) - [Commits](expressjs/express@4.19.2...4.21.0) --- updated-dependencies: - dependency-name: send dependency-type: indirect - dependency-name: express dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com>
…m_and_yarn/example/federation/integration/gateway/multi-cf87d80143 Bump send and express in /example/federation/integration/gateway
Bumps [cookie](https://github.com/jshttp/cookie) and [express](https://github.com/expressjs/express). These dependencies needed to be updated together. Updates `cookie` from 0.6.0 to 0.7.1 - [Release notes](https://github.com/jshttp/cookie/releases) - [Commits](jshttp/cookie@v0.6.0...v0.7.1) Updates `express` from 4.21.0 to 4.21.1 - [Release notes](https://github.com/expressjs/express/releases) - [Changelog](https://github.com/expressjs/express/blob/4.21.1/History.md) - [Commits](expressjs/express@4.21.0...4.21.1) --- updated-dependencies: - dependency-name: cookie dependency-type: indirect - dependency-name: express dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com>
…m_and_yarn/example/federation/integration/gateway/multi-9f37c16f8f Bump cookie and express in /example/federation/integration/gateway
Support for custom directives is desired to allow extension of the capabilities and behaviour of the GraphQL server. The current implementation would have allowed this, however the approach has become complex and limiting. In retrospect this would be better to be done in other ways to better support the future of the library.
Bumps [path-to-regexp](https://github.com/pillarjs/path-to-regexp) and [express](https://github.com/expressjs/express). These dependencies needed to be updated together. Updates `path-to-regexp` from 0.1.10 to 0.1.12 - [Release notes](https://github.com/pillarjs/path-to-regexp/releases) - [Changelog](https://github.com/pillarjs/path-to-regexp/blob/master/History.md) - [Commits](pillarjs/path-to-regexp@v0.1.10...v0.1.12) Updates `express` from 4.21.1 to 4.21.2 - [Release notes](https://github.com/expressjs/express/releases) - [Changelog](https://github.com/expressjs/express/blob/4.21.2/History.md) - [Commits](expressjs/express@4.21.1...4.21.2) --- updated-dependencies: - dependency-name: path-to-regexp dependency-type: indirect - dependency-name: express dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com>
…m_and_yarn/example/federation/integration/gateway/multi-6bc014718a
…ctives-support Remove Custom Directives Support
…eftovers remove directive leftovers
…tion-example update federation example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Update upstream to v1.6.0