forked from prisma/prisma-engines
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: enable field exclusion for the json protocol (prisma#4807)
- Loading branch information
Showing
21 changed files
with
468 additions
and
270 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
10 changes: 10 additions & 0 deletions
10
...uery_validation_tests/postgres_basic/selection_contains_unknown_excluded_field.query.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,10 @@ | ||
{ | ||
"action": "findMany", | ||
"modelName": "User", | ||
"query": { | ||
"selection": { | ||
"id": true, | ||
"unknown_field": false | ||
} | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
...lidation_tests/postgres_basic/selection_contains_unknown_nested_excluded_field.query.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,15 @@ | ||
{ | ||
"action": "findMany", | ||
"modelName": "User", | ||
"query": { | ||
"selection": { | ||
"id": true, | ||
"posts": { | ||
"selection": { | ||
"id": true, | ||
"unknown_field": false | ||
} | ||
} | ||
} | ||
} | ||
} |
File renamed without changes.
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
42 changes: 42 additions & 0 deletions
42
...ests/tests/query_validation_tests/selection_contains_unknown_excluded_field.expected.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,42 @@ | ||
{ | ||
"is_panic": false, | ||
"message": "Field 'unknown_field' not found in enclosing type 'User'", | ||
"meta": { | ||
"kind": "UnknownSelectionField", | ||
"outputType": { | ||
"name": "User", | ||
"fields": [ | ||
{ | ||
"name": "id", | ||
"typeName": "Int", | ||
"isRelation": false | ||
}, | ||
{ | ||
"name": "email", | ||
"typeName": "String", | ||
"isRelation": false | ||
}, | ||
{ | ||
"name": "dob", | ||
"typeName": "DateTime", | ||
"isRelation": false | ||
}, | ||
{ | ||
"name": "posts", | ||
"typeName": "Post[]", | ||
"isRelation": true | ||
}, | ||
{ | ||
"name": "_count", | ||
"typeName": "UserCountOutputType", | ||
"isRelation": false | ||
} | ||
] | ||
}, | ||
"selectionPath": [ | ||
"findManyUser", | ||
"unknown_field" | ||
] | ||
}, | ||
"error_code": "P2009" | ||
} |
38 changes: 38 additions & 0 deletions
38
...sts/query_validation_tests/selection_contains_unknown_nested_excluded_field.expected.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,38 @@ | ||
{ | ||
"is_panic": false, | ||
"message": "Field 'unknown_field' not found in enclosing type 'Post'", | ||
"meta": { | ||
"kind": "UnknownSelectionField", | ||
"outputType": { | ||
"name": "Post", | ||
"fields": [ | ||
{ | ||
"name": "id", | ||
"typeName": "Int", | ||
"isRelation": false | ||
}, | ||
{ | ||
"name": "name", | ||
"typeName": "String", | ||
"isRelation": false | ||
}, | ||
{ | ||
"name": "userId", | ||
"typeName": "Int", | ||
"isRelation": false | ||
}, | ||
{ | ||
"name": "user", | ||
"typeName": "User", | ||
"isRelation": true | ||
} | ||
] | ||
}, | ||
"selectionPath": [ | ||
"findManyUser", | ||
"posts", | ||
"unknown_field" | ||
] | ||
}, | ||
"error_code": "P2009" | ||
} |
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
42 changes: 42 additions & 0 deletions
42
query-engine/core-tests/tests/query_validation_tests/unknown_selection_field.expected.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,42 @@ | ||
{ | ||
"is_panic": false, | ||
"message": "Field 'notAField' not found in enclosing type 'User'", | ||
"meta": { | ||
"kind": "UnknownSelectionField", | ||
"outputType": { | ||
"name": "User", | ||
"fields": [ | ||
{ | ||
"name": "id", | ||
"typeName": "Int", | ||
"isRelation": false | ||
}, | ||
{ | ||
"name": "email", | ||
"typeName": "String", | ||
"isRelation": false | ||
}, | ||
{ | ||
"name": "dob", | ||
"typeName": "DateTime", | ||
"isRelation": false | ||
}, | ||
{ | ||
"name": "posts", | ||
"typeName": "Post[]", | ||
"isRelation": true | ||
}, | ||
{ | ||
"name": "_count", | ||
"typeName": "UserCountOutputType", | ||
"isRelation": false | ||
} | ||
] | ||
}, | ||
"selectionPath": [ | ||
"findManyUser", | ||
"notAField" | ||
] | ||
}, | ||
"error_code": "P2009" | ||
} |
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
Oops, something went wrong.