From ca0f0bd32d3334dfe7e016f11c9582c6e54e5422 Mon Sep 17 00:00:00 2001 From: Ben Sinclair Date: Sun, 21 Feb 2021 02:06:27 +1100 Subject: 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. --- CHANGELOG.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'CHANGELOG.md') diff --git a/CHANGELOG.md b/CHANGELOG.md index 246c907..017a14c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,10 @@ and this project adheres to - `Language.GraphQL.Execute.OrderedMap` is a map data structure, that preserves insertion order. +### Fixed +- Parser now accepts empty lists and objects. +- Parser now accepts all directive locations. + ## [0.11.1.0] - 2021-02-07 ### Added - `Validate.Rules`: @@ -109,7 +113,7 @@ and this project adheres to `locations`. - Parsing comments in the front of definitions. - Some missing labels were added to the parsers, some labels were fixed to - refer to the AST nodes being parsed. + refer to the AST nodes being parsed. ### Added - `AST` reexports `AST.Parser`. -- cgit v1.2.3