graphql-go
graphql-go copied to clipboard
Adding modifying field extraction
Adding a method for extract the fields that are being modifying in a mutation. The idea is to have a list of fields where each field is identified by the path (type.field). e.g.
Having as schema and query:
...
input PersonInput {
firstName: String!,
middleName: String,
lastName: String!
location: LocationInput
}
input LocationInput {
name: String!,
description: String
}
...
mutation addingPerson($name: String!) {
addPerson(person: {
firstName: $name,
middleName: null,
lastName: "Fixed Last Name",
location: {
name: "Fixed Location Name"
}
}) { id }
}
The list of fields that are being modified are:
person.firstName
, person.middleName
, person.lastName
, person.location.name
Note that person.location.description
is not provided, hence, it won't be listed.