graphql-python / gql

A GraphQL client in Python
https://gql.readthedocs.io
MIT License
1.56k stars 180 forks source link

DSL how to select fields which are Python reserved keywords #462

Closed FrankC01 closed 9 months ago

FrankC01 commented 9 months ago

Here is the problem I face, I can create this using document node:

     """      nodes {
              name
              isEntry
              visibility
              return {
                signature
              }
    """

(lines omitted)

However I would like to create a DSL fragment but return fails Python (i.e. Outer.return.select(...)

Is there a way to inject a partial DocumentNode into a DocementNode generated from dsl_gql?

leszekhanusz commented 9 months ago

You could use either:

FrankC01 commented 9 months ago

Works like a charm, exactley what I needed.

Kudos!!!