-
-
Notifications
You must be signed in to change notification settings - Fork 566
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
Port 0.12.3 changes from graphql-js #248
Commits on Feb 9, 2018
-
Configuration menu - View commit details
-
Copy full SHA for eb9ac66 - Browse repository at this point
Copy the full SHA eb9ac66View commit details -
Configuration menu - View commit details
-
Copy full SHA for 46816a7 - Browse repository at this point
Copy the full SHA 46816a7View commit details
Commits on Feb 10, 2018
-
This RFC adds a new form of `StringValue`, the multi-line string, similar to that found in Python and Scala. A multi-line string starts and ends with a triple-quote: ``` """This is a triple-quoted string and it can contain multiple lines""" ``` Multi-line strings are useful for typing literal bodies of text where new lines should be interpretted literally. In fact, the only escape sequence used is `\"""` and `\` is otherwise allowed unescaped. This is beneficial when writing documentation within strings which may reference the back-slash often: ``` """ In a multi-line string \n and C:\\ are unescaped. """ ``` The primary value of multi-line strings are to write long-form input directly in query text, in tools like GraphiQL, and as a prerequisite to another pending RFC to allow docstring style documentation in the Schema Definition Language. Ref: graphql/graphql-js#926
Configuration menu - View commit details
-
Copy full SHA for 8747ff8 - Browse repository at this point
Copy the full SHA 8747ff8View commit details -
Improvements to printing block strings
ref: graphql/graphql-js#f9e67c403a4667372684ee8c3e82e1f0ba27031b
Configuration menu - View commit details
-
Copy full SHA for e65638f - Browse repository at this point
Copy the full SHA e65638fView commit details -
As discussed in graphql/graphql-spec#90 This proposes replacing leading comment blocks as descriptions in the schema definition language with leading strings (typically block strings). While I think there is some reduced ergonomics of using a string literal instead of a comment to write descriptions (unless perhaps you are accustomed to Python or Clojure), there are some compelling advantages: * Descriptions are first-class in the AST of the schema definition language. * Comments can remain "ignored" characters. * No ambiguity between commented out regions and descriptions. Specific to this reference implementation, since this is a breaking change and comment descriptions in the experimental SDL have fairly wide usage, I've left the comment description implementation intact and allow it to be enabled via an option. This should help with allowing upgrading with minimal impact on existing codebases and aid in automated transforms. BREAKING CHANGE: This does not parse descriptions from comments by default anymore and the value of description in Nodes changed from string to StringValueNode
Configuration menu - View commit details
-
Copy full SHA for 022c490 - Browse repository at this point
Copy the full SHA 022c490View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7705e50 - Browse repository at this point
Copy the full SHA 7705e50View commit details -
Support for union types when using buildSchema
* Adds support for resolving union/interface types when using a generated schema * Move resolveType __typename checking into defaultResolveType * Clean up existing tests and improve error messages ref: graphql/graphql-js#947 # Conflicts: # src/Utils/BuildSchema.php # tests/Utils/BuildSchemaTest.php
Configuration menu - View commit details
-
Copy full SHA for 4e26de3 - Browse repository at this point
Copy the full SHA 4e26de3View commit details -
Add additional number lexing test
ref: graphql/graphql-js#72421378550cf51b13c6db59b8fc912591fd1a4b
Configuration menu - View commit details
-
Copy full SHA for 98e397c - Browse repository at this point
Copy the full SHA 98e397cView commit details -
Remove notes about subscription being experimental
ref: graphql/graphql-js#bf4a25a33a62280e82680518adc279e34ec816e0
Configuration menu - View commit details
-
Copy full SHA for 1fdb3da - Browse repository at this point
Copy the full SHA 1fdb3daView commit details -
Simplify operationTypes validation
ref: graphql/graphql-js#999 # Conflicts: # src/Utils/BuildSchema.php
Configuration menu - View commit details
-
Copy full SHA for 17a8c26 - Browse repository at this point
Copy the full SHA 17a8c26View commit details -
Add warnings for nullable changes
ref: graphql/graphql-js@db4cfdc ref: graphql/graphql-js#1096 # Conflicts: # tests/Utils/FindBreakingChangesTest.php
Configuration menu - View commit details
-
Copy full SHA for 2123946 - Browse repository at this point
Copy the full SHA 2123946View commit details -
Fix parsing of default values in build-schema
* Generalizes building a value from an AST, since "scalar" could be misleading, and supporting variable values within custom scalar literals can be valuable. * Replaces isNullish with isInvalid since `null` is a meaningful value as a result of literal parsing. * Provide reasonable default version of 'parseLiteral' ref: graphql/graphql-js@714ee98 ref: graphql/graphql-js#903 # Conflicts: # src/Utils/BuildSchema.php # tests/Utils/BuildSchemaTest.php
Configuration menu - View commit details
-
Copy full SHA for 27ce24b - Browse repository at this point
Copy the full SHA 27ce24bView commit details -
(Potentially Breaking) Allow serializing scalars as null.
This changes the check for null/undefined to a check for undefined to determine if scalar serialization was successful or not, allowing `null` to be returned from serialize() without indicating error. This is potentially breaking for any existing custom scalar which returned `null` from `serialize()` to indicate failure. To account for this change, it should either throw an error or return `undefined`. ref: graphql/graphql-js#1104
Configuration menu - View commit details
-
Copy full SHA for 48c3330 - Browse repository at this point
Copy the full SHA 48c3330View commit details -
Remove duplicated code from buildASTSchema and extendSchema
ref: graphql/graphql-js#1000 BREAKING CHANGE: SchemaBuilder::build() and buildAST() and constructor removed the typedecorator, as not needed anymore as library can now resolve union and interfaces from generated schemas.
Configuration menu - View commit details
-
Copy full SHA for 2cbccb8 - Browse repository at this point
Copy the full SHA 2cbccb8View commit details -
Configuration menu - View commit details
-
Copy full SHA for c4f11a5 - Browse repository at this point
Copy the full SHA c4f11a5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1da3801 - Browse repository at this point
Copy the full SHA 1da3801View commit details -
Configuration menu - View commit details
-
Copy full SHA for d6add77 - Browse repository at this point
Copy the full SHA d6add77View commit details
Commits on Feb 11, 2018
-
Configuration menu - View commit details
-
Copy full SHA for 0c32982 - Browse repository at this point
Copy the full SHA 0c32982View commit details -
This changes the parsing grammar and validation rules to more correctly implement the current state of the GraphQL SDL proposal (graphql/graphql-spec#90) ref: graphql/graphl-js#1102
Configuration menu - View commit details
-
Copy full SHA for d70a9a5 - Browse repository at this point
Copy the full SHA d70a9a5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 58453c3 - Browse repository at this point
Copy the full SHA 58453c3View commit details -
Validation: improving overlapping fields quality
This improves the overlapping fields validation performance and improves error reporting quality by separating the concepts of checking fields "within" a single collection of fields from checking fields "between" two different collections of fields. This ensures for deeply overlapping fields that nested fields are not checked against each other repeatedly. Extending this concept further, fragment spreads are no longer expanded inline before looking for conflicts, instead the fields within a fragment are compared to the fields with the selection set which contained the referencing fragment spread. e.g. ```graphql { same: a same: b ...X } fragment X on T { same: c same: d } ``` In the above example, the initial query body is checked "within" so `a` is compared to `b`. Also, the fragment `X` is checked "within" so `c` is compared to `d`. Because of the fragment spread, the query body and fragment `X` are checked "between" so that `a` and `b` are each compared to `c` and `d`. In this trivial example, no fewer checks are performed, but in the case where fragments are referenced multiple times, this reduces the overall number of checks (regardless of memoization). **BREAKING**: This can change the order of fields reported when a conflict arises when fragment spreads are involved. If you are checking the precise output of errors (e.g. for unit tests), you may find existing errors change from `"a" and "c" are different fields` to `"c" and "a" are different fields`. From a perf point of view, this is fairly minor as the memoization "PairSet" was already keeping these repeated checks from consuming time, however this will reduce the number of memoized hits because of the algorithm improvement. From an error reporting point of view, this reports nearest-common-ancestor issues when found in a fragment that comes later in the validation process. I've added a test which fails with the existing impl and now passes, as well as changed a comment. This also fixes an error where validation issues could be missed because of an over-eager memoization. I've also modified the `PairSet` to be aware of both forms of memoization, also represented by a previously failing test. ref: graphql/graphql-js#386
Configuration menu - View commit details
-
Copy full SHA for 7b05673 - Browse repository at this point
Copy the full SHA 7b05673View commit details -
Fix infinite loop on invalid queries in OverlappingFields
`OverlappingFieldsCanBeMerged` would infinite loop when passed something like ```graphql fragment A on User { name ...A } ``` It's not `OverlappingFieldsCanBeMerged`'s responsibility to detect that validation error, but we still would ideally avoid infinite looping. This detects that case, and pretends that the infinite spread wasn't there for the purposes of this validation step. Also, by memoizing and checking for self-references this removes duplicate reports. ref: graphql/graphql-js#1111
Configuration menu - View commit details
-
Copy full SHA for 6e358eb - Browse repository at this point
Copy the full SHA 6e358ebView commit details -
Improve introspection types + new getIntrospectionQuery()
This adds a new function `getIntrospectionQuery()` which allows for some minor configuration over the resulting query text: to exclude descriptions if your use case does not require them. ref: graphql/graphql-js#1113
Configuration menu - View commit details
-
Copy full SHA for ff63e07 - Browse repository at this point
Copy the full SHA ff63e07View commit details -
Configuration menu - View commit details
-
Copy full SHA for 74854d5 - Browse repository at this point
Copy the full SHA 74854d5View commit details -
This adds the recent changes to the SDL proposal. ref: graphql/graphql-js#1117
Configuration menu - View commit details
-
Copy full SHA for b5106a0 - Browse repository at this point
Copy the full SHA b5106a0View commit details -
Allow constructing GraphQLError with single node.
A common case is encountering an error which blames to a single AST node. Ensure the GraphQLError constructor can handle this case. ref: graphql/graphql-js#1123
Configuration menu - View commit details
-
Copy full SHA for 0c984a8 - Browse repository at this point
Copy the full SHA 0c984a8View commit details -
Include test that printSchema includes non-spec directives.
ref: graphql/graphql-js@007407d Also fixes expected <-> actual in this testfile
Configuration menu - View commit details
-
Copy full SHA for 481cdc9 - Browse repository at this point
Copy the full SHA 481cdc9View commit details -
Fix unhandled error when parsing custom scalar literals.
This factors out the enum value validation from scalar value validation and ensures the same try/catch is used in isValidLiteralValue as isValidPHPValue and protecting from errors in valueFromAST. ref: graphql/graphql-js#1126
Configuration menu - View commit details
-
Copy full SHA for f661f38 - Browse repository at this point
Copy the full SHA f661f38View commit details
Commits on Feb 12, 2018
-
Lifted from / inspired by a similar change in graphql/graphql-js#722, this creates a new function `printError()` (and uses it as the implementation for `GraphQLError#toString()`) which prints location information in the context of an error. This is moved from the syntax error where it used to be hard-coded, so it may now be used to format validation errors, value coercion errors, or any other error which may be associated with a location. ref: graphql/graphql-js BREAKING CHANGE: The SyntaxError message does not contain the codeframe anymore and only the message, (string) $error will print the codeframe.
Configuration menu - View commit details
-
Copy full SHA for 15374a3 - Browse repository at this point
Copy the full SHA 15374a3View commit details
Commits on Feb 13, 2018
-
Validate schema root types and directives
This moves validation out of GraphQLSchema's constructor (but not yet from other type constructors), which is responsible for root type validation and interface implementation checking. Reduces time to construct GraphQLSchema significantly, shifting the time to validation. This also allows for much looser rules within the schema builders, which implicitly validate while trying to adhere to flow types. Instead we use any casts to loosen the rules to defer that to validation where errors can be richer. This also loosens the rule that a schema can only be constructed if it has a query type, moving that to validation as well. That makes flow typing slightly less nice, but allows for incremental schema building which is valuable ref: graphql/graphql-js#1124
Configuration menu - View commit details
-
Copy full SHA for 06c6c4b - Browse repository at this point
Copy the full SHA 06c6c4bView commit details -
Fix printError/locations for multiple nodes.
If a GraphQLError represents multiple nodes across files (could happen for validation across multiple parsed files) then the reported locations and printError output can be incorrect for the second node. This ensures locations are derived from nodes whenever possible to get correct location and amends comment documentation. ref: graphql/graphql-js#1131
Configuration menu - View commit details
-
Copy full SHA for cf27634 - Browse repository at this point
Copy the full SHA cf27634View commit details -
Always extract extensions from the original error if possible
ref: graphql/graphql-js#2d08496720088dbe65ebea312c8526bd48fb8ee8
Configuration menu - View commit details
-
Copy full SHA for 6d45a22 - Browse repository at this point
Copy the full SHA 6d45a22View commit details -
Preserve original coercion errors, improve error quality.
This is a fairly major refactoring of coerceValue which returns an Either so it can return a complete collection of errors. This allows originalError to be preserved for scalar coercion errors and ensures *all* errors are represented in the response. This had a minor change to the logic in execute / subscribe to allow for buildExecutionContext to abrupt complete with multiple errors. ref: graphql/graphql-js#1133
Configuration menu - View commit details
-
Copy full SHA for 60df83f - Browse repository at this point
Copy the full SHA 60df83fView commit details -
Introduces new assertion functions for each kind of type mirroring the existing ones for the higher order types. ref: graphql/graphql-js#1137
Configuration menu - View commit details
-
Copy full SHA for 9387548 - Browse repository at this point
Copy the full SHA 9387548View commit details -
Configuration menu - View commit details
-
Copy full SHA for 50cbfb4 - Browse repository at this point
Copy the full SHA 50cbfb4View commit details -
Address recent SDL spec changes
This should be the last set of spec changes for a standardized SDL ref: graphql/graphql-js#1139
Configuration menu - View commit details
-
Copy full SHA for 6d08c34 - Browse repository at this point
Copy the full SHA 6d08c34View commit details
Commits on Feb 15, 2018
-
Move schema validation into separate step (type constructors)
This is the second step of moving work from type constructors to the schema validation function. ref: graphql/graphql-js#1132
Configuration menu - View commit details
-
Copy full SHA for 97e8a9e - Browse repository at this point
Copy the full SHA 97e8a9eView commit details -
There are possibilities for errors during validation if a schema is not valid when provided to TypeInfo. Most checks for validity existed, but some did not. This asks flow to make those checks required and adds the remaining ones. Important now that we allow construction of invalid schema. ref: graphql/graphql-js#1143
Configuration menu - View commit details
-
Copy full SHA for fde7df5 - Browse repository at this point
Copy the full SHA fde7df5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 949b853 - Browse repository at this point
Copy the full SHA 949b853View commit details -
Update some validators to latest upstream version
This includes: graphql/graphql-js#1147 graphql/graphql-js#355 This also fixes two bugs in the Schema - types that were not found where still added to the typeMap - InputObject args should not be searched for types.
Configuration menu - View commit details
-
Copy full SHA for 1752087 - Browse repository at this point
Copy the full SHA 1752087View commit details -
Validate literals in a single rule with finer precision
This generalizes the "arguments of correct type" and "default values of correct type" to a single rule "values of correct type" which has been re-written to rely on a traversal rather than the utility function `isValidLiteralValue`. To reduce breaking scope, this does not remove that utility even though it's no longer used directly within the library. Since the default values rule included another validation rule that rule was renamed to a more apt "variable default value allowed". This also includes the original errors from custom scalars in the validation error output, solving the remainder of graphql/graphql-js#821. ref: graphql/graphql-js#1144
Configuration menu - View commit details
-
Copy full SHA for 58e0c7a - Browse repository at this point
Copy the full SHA 58e0c7aView commit details -
Fix path argument. Enchance visit test to validate all arguments
ref: graphl/graphql-js#1149
Configuration menu - View commit details
-
Copy full SHA for ddfeee3 - Browse repository at this point
Copy the full SHA ddfeee3View commit details -
Configuration menu - View commit details
-
Copy full SHA for d71b45d - Browse repository at this point
Copy the full SHA d71b45dView commit details
Commits on Feb 16, 2018
-
Configuration menu - View commit details
-
Copy full SHA for 48c5e64 - Browse repository at this point
Copy the full SHA 48c5e64View commit details -
Add suggestions for invalid values
For misspelled enums or field names, these suggestions can be helpful. This also changes the suggestions algorithm to better detect case-sensitivity mistakes, which are common ref: graphql/graphql-js#1153
Configuration menu - View commit details
-
Copy full SHA for d92a2da - Browse repository at this point
Copy the full SHA d92a2daView commit details -
Configuration menu - View commit details
-
Copy full SHA for dc6e814 - Browse repository at this point
Copy the full SHA dc6e814View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5e7cf2a - Browse repository at this point
Copy the full SHA 5e7cf2aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 61fe317 - Browse repository at this point
Copy the full SHA 61fe317View commit details -
Configuration menu - View commit details
-
Copy full SHA for f9a366e - Browse repository at this point
Copy the full SHA f9a366eView commit details
Commits on Mar 6, 2018
-
Configuration menu - View commit details
-
Copy full SHA for 3e067cc - Browse repository at this point
Copy the full SHA 3e067ccView commit details