commercetools-python-sdk icon indicating copy to clipboard operation
commercetools-python-sdk copied to clipboard

graphql usage

Open dimentii opened this issue 1 year ago • 0 comments

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.

dimentii avatar Nov 06 '23 13:11 dimentii