How to use the gql.dsl.DSLField function in gql

To help you get started, we’ve selected a few gql examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github graphql-python / gql / gql / dsl.py View on Github external
def field(field, **args):
    if isinstance(field, GraphQLField):
        return DSLField(field).args(**args)
    elif isinstance(field, DSLField):
        return field

    raise Exception('Received incompatible query field: "{}".'.format(field))
github graphql-python / gql / gql / dsl.py View on Github external
def __getattr__(self, name):
        formatted_name, field_def = self.get_field(name)
        return DSLField(formatted_name, field_def)