Iterate on your Data Model
After you have successfully created a DDN supergraph to use with PromptQL, you will soon want to iterate on your data model to reflect changes in the underlying data sources
Changing your underlying data model
Depending on your data source, you may be adding a column to a table in PostgreSQL, or a creating a new collection in MongoDB. You may have written new custom logic in TypeScript or want to import a new command from the Stripe connector. Whatever it is, you will follow the same steps each time anything changes in your data source schema to iterate on your data model.
Re-introspecting your data model
Re-introspecting your data model will update the connector configuration to reflect the changes in your data sources.
ddn connector introspect my_connector
Viewing resources
ddn connector show-resources my_connector
Adding resources
ddn model add my_connector my_model
ddn command add my_connector my_command
ddn relationship add my_connector my_relationship
ddn model add my_connector "*"
ddn command add my_connector "*"
ddn relationship add my_connector "*"
Adding semantic Information
It's highly recommended to provide extra natural language descriptions of the resources in your project so that the PromptQL can better understand your data and create appropriate query plans.
The description field can be added to Model
, Command
and Relationship
metadata elements to provide semantic
context. See more about semantic information here.
Building a new supergraph
ddn supergraph build local
You can also build a new supergraph for a project on Hasura Cloud:
If you don't have a project on Hasura Cloud, you can create one by running:
ddn project init
Then:
ddn supergraph build create
Restarting services locally
If you are iterating locally, you then need to restart the Docker services by running:
ddn run docker-start