- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature/validate single top level field on subscription (#428)
* implement validation * subscription * liftWS * single selection * add tests * withScope * fix tests * city * update * update changelog * fix wrong field name on missing argument * update changelog
1 parent
edd66a1
commit 680eee1
Showing
16 changed files
with
125 additions
and
24 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
2 changes: 1 addition & 1 deletion
2
test/Feature/Holistic/arguments/undefinedArgument/response.json
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -102,4 +102,5 @@ type Mutation { | |
|
||
type Subscription { | ||
newUser: User! | ||
newAddress: Address! | ||
} |
8 changes: 8 additions & 0 deletions
8
test/Feature/Holistic/selection/subscription/singleTopLevelField/fail/query.gql
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
subscription SomeTestSubscription { | ||
newUser { | ||
name | ||
} | ||
newAddress { | ||
houseNumber | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
test/Feature/Holistic/selection/subscription/singleTopLevelField/fail/response.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"errors": [ | ||
{ | ||
"message": "Subscription \"SomeTestSubscription\" must select only one top level field.", | ||
"locations": [ | ||
{ | ||
"line": 5, | ||
"column": 14 | ||
} | ||
] | ||
} | ||
] | ||
} |
11 changes: 11 additions & 0 deletions
11
test/Feature/Holistic/selection/subscription/singleTopLevelField/failAnonymous/query.gql
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
subscription { | ||
newUser { | ||
name | ||
} | ||
newAddress { | ||
houseNumber | ||
} | ||
address2: newAddress { | ||
houseNumber | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
test/Feature/Holistic/selection/subscription/singleTopLevelField/failAnonymous/response.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"errors": [ | ||
{ | ||
"message": "Anonymous Subscription must select only one top level field.", | ||
"locations": [ | ||
{ | ||
"line": 5, | ||
"column": 14 | ||
} | ||
] | ||
}, | ||
{ | ||
"message": "Anonymous Subscription must select only one top level field.", | ||
"locations": [ | ||
{ | ||
"line": 8, | ||
"column": 24 | ||
} | ||
] | ||
} | ||
] | ||
} |