Solved

Get access to GraphQL through python SDK

  • 3 November 2023
  • 3 replies
  • 66 views

As Data Engineer I need access to GraphQL through python SDK

  • to modify Data Models GraphQL: to update versions of imported views from different Data Models
  • to read Data Models GraphQL: to parse specific info that I can not get through python SDK. For example
    • check if view was imported
    • what the source of imported view
icon

Best answer by Dimitry Hoff 6 November 2023, 15:23

View original

3 replies

Hi,
Have you tried using existing GraphQL client libraries in python, for example
https://pypi.org/project/python-graphql-client/

It should work "out of the box", provided with a URL to GraphQL endpoint and Bearer Token for authentication.

GraphQL endpoint url can be found in Data Modeling UI, if you click on the URL button.
As for Bearer Token it is the same token that is used to authenticate to CDF (see https://developer.cognite.com/sdks/python/python_auth_oidc) and can be acquired with msal (already installed with cognite-sdk) and

Thank you

Userlevel 6
Badge

@almir.mavliutov thanks for your questions! We hope @Dimitry Hoff’s reply helped. We’ll convert this thread into a question, please do reach out should you have further questions or thoughts. 

Reply