Custom, non-entity backed types
Possibly related to #79 and #77
It would be nice to be able to create custom types that can be used in other type definitions, but do not correspond to a resource/permissions on their own. The current workaround is to either use the Json scalar type, but then we lose the benefit of type-checking, or create a normal type and associated relationships which adds a lot of unnecessary noise.
Ex.
type Location {
address: String!
city: String!
}
type Person {
name: String!
location: Location!
}
type Business {
url: String!
location: Location!
}
I can confirm that we had a lot of real-world use for a feature like this on a different graphqlAAS provider.
This feature is even more useful/important with the recent addition of resolver functions. See also #318.
This is very useful. We have to add A LOT of on-to-one relations to support nested fields. And in some instances we just have to fallback to JSON because there is no other way
These could even be used as storage types, with storage set to 'parent', meaning it will actually be stored as Json on the parent type. But the most obvious examples are of course resolver functions.
Closing in favour of #1160.
@alexeygolev It would be very helpful if you could describe a case where JSON is currently the only option, but embedded types as described here would work.