This repository was archived by the owner on Feb 10, 2022. It is now read-only.

Description
In order to be friendly with Relay and graphql-relay-js lib, the API needs to allow the user to append some fields directly to an Object or an Interface.
Example would be to use the globalIdField or the mutationWithClientMutationId helpers from graphql-relay-js.
I was tempted to hack the field method but then it breaks the promise that it's a field you can build on (add some args and define the resolve method) because the passed object literal define all of those already.
I suspect to avoid any confusion, we should have an explicit method to handle this.
May be appendField(name:String,field:Object) and it would do :
appendField(name,field) {
this.__saveField();
invariant(
!this.fields[name],
`appendField(...): '${name}' is already defined`
);
this.fields[name] = field;
}
What do you think ?