Showing results for 
Search instead for 
Did you mean: 

Head's Up! Site migration is underway. Phase 2: migrate recent content

GraphQL - Create an extra field using Custom Mutation

Node Clone

I need to create an extra field from the 3 fields from the input. 

name, age, and year will be part of the input to a create request, and I want to customize the mutation on the server and add an extra field to the input the let the remaining process complete.

name_age_year = `${} ${source.age} ${source.year}`;

Can anyone suggest how can I do it?

I need this extra property inside the database for other purposes.

Product type:

type Product {
	name: String
	age: String
	year: String
	name_age_year: String