concept name in category graphql

This is an excerpt from Manning's book GraphQL in Action.
The service can receive and parse any request. It will then try to validate the request against its schema. The schema has to support an
employeefield and that field has to represent an object that has anidargument, anamefield, and anidargument can be an integer. Thenameandemployeefield is a custom type (representing that exact id/name/email structure).
Write any non-default resolvers for the Usertype. Let’s combine the dbfirst_nameandlast_namecolumns on tableazdev.usersinto a singlenamefield for the API.
Here’s a possible implementation of the new User type along with its non-default resolver for the
namefield:Listing 6.28. New file:
api/src/schema/types/user.jsimport { GraphQLID, GraphQLObjectType, GraphQLString, GraphQLNonNull, } from 'graphql'; const User = new GraphQLObjectType({ name: 'User', fields: { id: { type: new GraphQLNonNull(GraphQLID) }, username: { type: GraphQLString }, name: { type: GraphQLString, resolve: ({ firstName, lastName }) => `${firstName} ${lastName}`, }, }, }); export default User;Note how for the
resolvefunctions of thenamefield, I destructured the properties that are to be used in the resolver out of the firstsourceargument.