Skip to content

[Proposal] Add addField method for object type #1774

Closed
@pd4d10

Description

@pd4d10

Currently there seems no way to manipulate existing object types. It would be handy to have addField method as follows:

const objType = new GraphQLObjectType({
  name: 'SomeObject',
  fields: {},
});

objType.addField('add', { name: 'add', type: GraphQLInt });

objType.getFields()
// {
//   add: { name: 'add', type: GraphQLInt },
// );

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions