Sparse Update POC: Graphql-java interception
Pre-release
Pre-release
·
2 commits
to validate-presence-fields
since this release
Description
Sparse Update POC with : Graphql-java interception
This implementation overrides instrumentation for graphql-java to add raw variables from mutation input to graphql context.
Please use git checkout graphql-java-interception to try this out.
Mutation:
query getShow {
show(id:"one") {
title
releaseYear
}
}
//output
{
"data": {
"show": {
"title": "Show One",
"releaseYear": 2023
}
}
}
mutation updateShow($input: UpdateShowInput!) {
updateShow(input: $input) {
id
title
releaseYear
}
}
// Variables
{
"input": {
"id": "one",
"title": "New Show"
}
}
// output
{
"data": {
"updateShow": {
"id": "one",
"title": "New Show",
"releaseYear": 2023
}
}
}
Title is updated to "New Show" without affecting the value of "releaseYear" even though it is not supplied by the client in input variables.
Implementation used:
- Adding raw variables to dfe context through customized
graphql-javainstrumentation forbeginExecution - Presence (boolean) fields for
titleandreleaseYear