Commit Graph

196 Commits

Author SHA1 Message Date
9021f3a25d
Encode input object types 2023-01-10 09:53:18 +01:00
025331a9ee
Encode enums 2023-01-09 20:56:21 +01:00
ab4808c44d
Encode unions 2023-01-08 17:33:25 +01:00
70dedb6911
Encode interfaces (2018) 2023-01-02 10:30:37 +01:00
a96d4e6ef3
Add Semigroup and Monoid instances for Description 2022-12-27 10:38:08 +01:00
3ce6e7da46
Encode schema definitions 2022-12-25 16:38:00 +01:00
2f9881bb21
Fix GHC 9.2 warnings and deprecations
- Fix GHC 9.2 warnings
- Convert comments to proper deprecations
2022-12-24 18:09:52 +01:00
bf2e4925b4
Add operation type encoder 2022-10-02 11:38:53 +02:00
2321d1a1bc
Eliminate non-exhaustive patterns in ExecuteSpec 2022-07-02 15:29:35 +02:00
2f19093803
Change execute' to shouldResolveTo helper method 2022-07-01 12:18:02 +02:00
Dmitrii Skurikhin
8503c0f288 enhance query errors 2022-02-16 08:58:16 +01:00
Dmitrii Skurikhin
05e6aa4c95 add Arbitrary instances for AST.Document, add random arguments Parser test 2022-02-14 19:18:13 +01:00
Dmitrii Skurikhin
0c8edae90a fix empty list argument parsing 2022-01-09 09:00:56 +01:00
Dmitrii Skurikhin
1f7bd92d11 fix index position in error path 2022-01-07 08:31:47 +01:00
116aa1f6bb
Put JSON support behind a flag 2021-12-24 13:35:18 +01:00
0047a13bc0
Move JSON tests to the upcoming extra package 2021-11-22 07:22:28 +01:00
fbfbb3e73f
Remove raw-strings-qq 2021-09-23 08:23:38 +02:00
eedab9e742
Don't append a trailing newline in gql 2021-09-22 08:50:20 +02:00
60d1167839
Test nullability on value completion 2021-09-17 10:01:14 +02:00
b96d75f447
Replace the old executor 2021-09-03 22:47:49 +02:00
7b4c7e2b8c
Handle argument locations 2021-09-02 08:45:23 +02:00
233a58094d
Adjust value completion tests 2021-09-01 09:27:12 +02:00
b580d1a988
Attach the field location to resolver exceptions 2021-06-27 13:42:58 +02:00
96bb061666
Fail with a location for result coercion
The intermediate representation was further modified so that the
operation definitions contain location information. Probably I should
introduce a data type that generalizes fields and operations, so it
contains object type, location and the selection set, so the functions
don't accept so many arguments.
2021-06-24 09:29:24 +02:00
812f6967d4
Provide locations for argument errors
The executor still doesn't give an error per argument, but a single
error per field with locations for all arguments.
If a non-null argument isn't specified, only the error location of the
field is given. If some arguments cannot be coerced, only the locations
of these arguments are given, non-null arguments are ignored. This
should still be improved, so the executor returns all errors at once.
The transformation tree is changed, so that argument map contains
locations of the arguments (but not the locations of the argument values
yet).
2021-06-22 09:13:27 +02:00
6fe9eb72e4
Fix merging fields with arguments
executeField shouldn't assume that a selection has only one field with a
given name, but it should take the first field. The underlying cause is
a wrong pattern, which (because of the laziness) is executed only if the
field has arguments.
2021-06-18 06:51:14 +02:00
2ce2be5d91
Provide location information for interface errors 2021-06-17 08:15:27 +02:00
c311cb0070
Add constructor with additional schema types 2021-05-13 17:40:38 +02:00
1b7cd85216
Add location information to the intermediate tree 2021-05-12 06:51:59 +02:00
1af95345d2 Deprecate internal error generation functions
The functions generating errors in the executor should be changed anyway
when we provide better error messages from the executor, with the error
location and response path. So public definitions of these functions are
deprecated now and they are replaced by more generic functions in the
executor code.
2021-05-10 09:43:39 +02:00
0d23df3da2
Provide an internal function to add errors
The old function, addErrMsg, takes only a string with an error
description, but more information is required for the execution errors:
locations and path. addErrMsg should be deprecated after the switching
to the new addError.
2021-05-09 12:42:02 +02:00
5a5f265fe4 Validate non-nullable values inside lists 2021-05-06 22:23:16 +02:00
5654b78935
Traverse input object properties once 2021-04-12 07:09:39 +02:00
328e6acdee
Emit list item errors once 2021-03-16 10:08:13 +01:00
Ben Sinclair
ca0f0bd32d Fix some issues with directive definitions
I found some issues with directive definitions:

- I couldn't use `on FIELD_DEFINITION`, I believe because `FIELD` was parsed
  first in `executableDirectiveLocation`. I've combined both
  `executableDirectiveLocation` and `typetypeSystemDirectiveLocation` into one
  function which can reorder them to ensure every directive location gets a fair
  chance at parsing.

Not actually to do with directives, some literals weren't being parsed
correctly.

- The GraphQL spec defines list to be `[]` or `[Value]`, but empty literal lists
  weren't being parsed correctly because of using `some` instead of `many`.

- The GraphQL spec defines objects to be `{}` or `{Name: Value}`, but empty
  literal objects had the same issue.
2021-02-21 23:35:34 +11:00
10e4d64052 Replace Map with OrderedMap 2021-02-19 08:09:04 +01:00
d74e27e903 traverseMaybe OrderedMap 2021-02-15 09:04:16 +01:00
90d36f66b9 Combine value inserted into the OrderedMap 2021-02-14 14:46:06 +01:00
c1a1b47aea Add OrderedMap prototype 2021-02-13 06:56:10 +01:00
ed725ea514 Split validation rule tests in contexts 2021-02-06 12:54:27 +01:00
b27da54bf4 Provide custom Show instances for AST values 2021-02-04 08:12:12 +01:00
a034f2ce4d Validate values 2021-02-03 05:47:40 +01:00
22abf7ca58 Validate variable usages are allowed in arguments 2020-12-26 06:31:56 +01:00
2dbc985dfc Validate fragment spreads are possible 2020-11-19 08:48:37 +01:00
1f4eb6fb9b Implement basic "Field Selection Merging" rule 2020-11-15 10:11:09 +01:00
4a3b4cb16d Fix singleFieldSubscriptionsRule fragment lookup
singleFieldSubscriptionsRule picks up a wrong fragment definition.
2020-11-06 08:33:51 +01:00
7f0fb18716 Remove StarWars tests
Our own test suite is slowly getting sufficient.
2020-11-05 07:55:22 +01:00
7c0b0ace4d Collect types once the schema is created 2020-10-07 05:24:51 +02:00
a91bc7f2d2 Validate required input fields 2020-10-05 14:51:21 +02:00
d5f518fe82 Validate required arguments 2020-10-03 07:34:34 +02:00