-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Extend the extend functionality #1095
Comments
Syntax for this exists, however |
I've began the work to add the logic to I'm preparing a pull request with my changes. Is there any guidelines on how to submit a PR or I just have to refer to the |
@mgrenier Great 👍 You can submit WIP PR and get some early feedback. extend input User {
friends: [User]
} |
Thanks for implementing this. Is passing the extended input fields supported?
const { graphql, buildSchema } = require('graphql');
const schema = buildSchema(`
input User {
username: String!
}
extend input User {
password: String!
}
type Query {
hello: String
}
type Mutation {
createUser(user: User): Boolean
}
`);
var root = { createUser: user => console.log(user) };
graphql(schema, `mutation {
createUser(user: {
username: "john"
password: "secret"
})
}`, root).then((response) => {
console.log(response);
}); |
Is there any news on this? |
@dandv @csantos1113 Currently |
Currently, it's only possible to extend object types by spec. However, when using schema stitching, I'm running into use case where it would be nice to be able to extend other parts of my schema, like unions, interfaces, enums and input types.
I would like to be able to use the same syntax as for object types. For interfaces, enums and input types, I don't see any issues with that. For unions, the syntax is a bit different, so I'm open to suggestions for how that might look. As an alternative, the use case for unions might also be dealt with when merging schemas. If you agree with that, I will open an issue on graphql-tools for that. But for interfaces, enums, and input types, I think the change should be on the graphql-js side.
Examples:
The text was updated successfully, but these errors were encountered: