Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC: WithMetadata modifier #1089

Closed
brysgo opened this issue Nov 15, 2017 · 3 comments
Closed

RFC: WithMetadata modifier #1089

brysgo opened this issue Nov 15, 2017 · 3 comments

Comments

@brysgo
Copy link

brysgo commented Nov 15, 2017

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.

@IvanGoncharov
Copy link
Member

@brysgo This feature requires changes to GraphQL specification so it should be discussed in this repo: https://github.com/facebook/graphql
For example #914 is based on graphql/graphql-spec#326
Can you please move your issue there?

@brysgo
Copy link
Author

brysgo commented Nov 15, 2017

Alright @IvanGoncharov - see 381 above ^^^

@leebyron
Copy link
Contributor

leebyron commented Dec 7, 2017

Closing here in favor of non-library-specific discussion

@leebyron leebyron closed this as completed Dec 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants