Skip to content

RFC: WithMetadata modifier #1089

Closed
Closed
@brysgo

Description

@brysgo

WithMetadata Modifier

When wrapped a WithMetadata Modifier, a scalar field can have an optional
selection underneath it. When a selection is present, the value field holds
the scalar, when a selection is not present, the scalar is returned.

Example:

const NameType = new WithMetadata(GraphQLString, new GraphQLObjectType({
  name: 'Name',
  fields: () => ({
    firstName: { type: GraphQLString },
    middleName: { type: GraphQLString },
    lastName: { type: GraphQLString },
    nickname: { type: GraphQLString }
  })
}))

Or in graphql:

type Name: String {
  firstName: String
  middleName: String
  lastName: String
  nickname: String
}

Not sure if #914 helps to make this possible, would love to hear everyone's thoughts.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions