Solved

How Are GraphQL Mutations Defined in the CDF Template Syntax

  • 3 March 2022
  • 1 reply
  • 74 views

Userlevel 3

I am seeing how to create Templates used to query data, but I have not yet found information related to defining GraphQL mutations.  Do you know where I can find this information?  Thanks!

 

Here are some places I’ve been looking.

Docs:

Templates | Cognite Documentation
About template management | Cognite Documentation
Search results for "templates" | Cognite Documentation

The tests in the Python SDK:

https://github.com/cognitedata/cognite-sdk-python/blob/master/tests/tests_integration/test_api/test_templates.py

 

There is some info related to GraphQL mutations and Cognite here, but this doesn’t seem related to Cognite’s Template functionality:

https://itg.cognite.ai/docs/tutorials/data-ingestion/ingesting-data
https://github.com/cognitedata/sample-cdf-graphql-angular-app/blob/9641e4967e0a288241ef68b3e94786b56de456c2/src/app/itg-api.service.ts#L125

icon

Best answer by David Liu 7 March 2022, 11:12

View original

1 reply

Userlevel 4

Hi Ben!

This is great feedback for us! We have not planned to add any ability to mutate data via the GraphQL interface and was looking for requests regarding this feature. We have SDKs that makes it easy to ingest and mutate data in Templates and we are just finishing up the final documentation this week, and I will post it in this thread and also in the Flexible Data Modeling Cognite Hub group.

As for the last link, that is towards a prototype called ITG which provided us learnings around mutations that we hope to capture (along with feedback like this around Templates) as we are building more data modeling feature this year. 

I will share an early preview of the “documentation for modifying data via SDK” with you now, and share it publicly here once it is live later this week.

Reply