Simple objects plugin
The Simple Objects Plugin provides a way to define objects and interfaces without defining type definitions for those objects, while still getting full type safety.
Usage
Install
Setup
Example
Extending simple objects
In some cases, you may want to add more complex fields with resolvers or args where the value isn't just passed down from the parent.
In these cases, you can either add the field in the 3rd arg (fields) as shown above, or you can add
additional fields to the type using methods like builder.objectType
:
Limitations
When using simpleObjects in combination with other plugins like authorization, those plugins may use
unknown
as the parent type in some custom fields (eg. parent
of a permission check function on
a field).