Extending an Object Type in Code
See original GitHub issue(Posting here since haven’t been able to get an answer from any other of channels. 😅)
So, using SDL you can add fields to an existing type like:
extend type Query {
extraField: Int!
}
But how can I do this in code using the built-in classes (GraphQLObjectType, etc)?
Sounds like extendSchema might offer a way, but it is undocumented and I’m not sure how to use it in this case.
Is this supported?
My apologies in advance if I’m missing something really obvious.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:4
- Comments:8 (1 by maintainers)
Top Results From Across the Web
Extending object-like types with interfaces in TypeScript
There are a few different ways to extend object-like types with interfaces in TypeScript, and, sometimes, you may use type aliases. In those ......
Read more >How to Extend an Object in JavaScript ? - GeeksforGeeks
The extends keyword can be used to extend the objects as well as classes in JavaScript. It is usually used to create a...
Read more >extends - JavaScript - MDN Web Docs - Mozilla
The extends keyword can be used to subclass custom classes as well as built-in objects. Any constructor that can be called with new...
Read more >Extending an Object in Javascript - function - Stack Overflow
You want to 'inherit' from Person's prototype object: var Person = function (name) { this.name = name; this.type = 'human'; }; ...
Read more >Extending Classes | Think Java | Trinket
In Java, classes may extend only one superclass. Classes that do not specify a superclass with extends automatically inherit from java.lang.Object . So...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

can we reopen this?
as extendSchema only works with SDL and not with graphql-js types?
+1, wanna reference external type for apollo federation as a plain string, but don’t see other way than low-level string replace atm