Is there a way to dry up the datamodel.graphql and...
# orm-help
h
Is there a way to dry up the datamodel.graphql and typeDefs.graphql files... such that the latter imports everything from the former unless overridden?
👍 2
To this end, I've had some limited luck with
graphql-import
, but it falls apart if I need to import anything from my datamodel into my app schema that has a
@unique
directive. In those cases, I get the following error:
Copy code
Error: Directive unique: Couldn't find type unique in any of the schemas.
What I am trying to avoid is having to manually duplicate every enum, minor chunklet of model, etc, from my data model into my app schema. That seems very redundant and like it could have the potential to drift out of sync
v
Good question!
n
You don't want to import from the datamodel, you want to import from the GraphQL schema which is generated based on the datamodel
👍 1