labd / commercetools-python-sdk

Commercetools Python SDK
https://commercetools-python-sdk.readthedocs.io/en/latest/
MIT License
17 stars 16 forks source link

graphql usage #145

Open dimentii opened 1 year ago

dimentii commented 1 year ago

Hi, I could not find how to properly build GraphQLRequest object. Trying to build it like body = GraphQLRequest( query="""query ReturnProductsIds($limit: Int!, $offset: Int!) { products( where: "masterData(published=true)" sort: "id asc" offset: $offset limit: $limit ) { results { id } } }""", variables=GraphQLVariablesMap([('limit', 500), ('offset', 0)]) ) and it doesn't work. After object serialization variables become empty dict which causes error response from commercetools API Appreciate if you provide an example.