Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
# previous versions allowed Python name as dict keys
v = value[f.name]
except KeyError: # pragma: no cover
continue
vs = f.type.__to_graphql_input__(v, indent, indent_string)
args.append('%s: %s' % (f.graphql_name, vs))
return '{' + ', '.join(args) + '}'
########################################################################
# Built-in types
########################################################################
class Int(Scalar):
'''Maps GraphQL ``Int`` to Python ``int``.
>>> Int # or repr()
scalar Int
>>> str(Int)
'Int'
>>> bytes(Int)
b'scalar Int'
'''
converter = int
class Float(Scalar):
'Maps GraphQL ``Float`` to Python ``float``.'
converter = float
scalar Int
>>> str(Int)
'Int'
>>> bytes(Int)
b'scalar Int'
'''
converter = int
class Float(Scalar):
'Maps GraphQL ``Float`` to Python ``float``.'
converter = float
class String(Scalar):
'Maps GraphQL ``String`` to Python ``str``.'
converter = str
class Boolean(Scalar):
'Maps GraphQL ``Boolean`` to Python ``bool``.'
converter = bool
class ID(Scalar):
'Maps GraphQL ``ID`` to Python ``str``.'
converter = str
class UnknownType(Type):
'Type found in the response that was not present in schema'
class Float(Scalar):
'Maps GraphQL ``Float`` to Python ``float``.'
converter = float
class String(Scalar):
'Maps GraphQL ``String`` to Python ``str``.'
converter = str
class Boolean(Scalar):
'Maps GraphQL ``Boolean`` to Python ``bool``.'
converter = bool
class ID(Scalar):
'Maps GraphQL ``ID`` to Python ``str``.'
converter = str
class UnknownType(Type):
'Type found in the response that was not present in schema'
__auto_register = False # do not expose this in Schema, just subclasses
map_python_to_graphql = {
int: Int,
float: Float,
str: String,
bool: Boolean,
id: ID,
}
'''
converter = int
class Float(Scalar):
'Maps GraphQL ``Float`` to Python ``float``.'
converter = float
class String(Scalar):
'Maps GraphQL ``String`` to Python ``str``.'
converter = str
class Boolean(Scalar):
'Maps GraphQL ``Boolean`` to Python ``bool``.'
converter = bool
class ID(Scalar):
'Maps GraphQL ``ID`` to Python ``str``.'
converter = str
class UnknownType(Type):
'Type found in the response that was not present in schema'
__auto_register = False # do not expose this in Schema, just subclasses
map_python_to_graphql = {
int: Int,
class Int(Scalar):
'''Maps GraphQL ``Int`` to Python ``int``.
>>> Int # or repr()
scalar Int
>>> str(Int)
'Int'
>>> bytes(Int)
b'scalar Int'
'''
converter = int
class Float(Scalar):
'Maps GraphQL ``Float`` to Python ``float``.'
converter = float
class String(Scalar):
'Maps GraphQL ``String`` to Python ``str``.'
converter = str
class Boolean(Scalar):
'Maps GraphQL ``Boolean`` to Python ``bool``.'
converter = bool
class ID(Scalar):
'Maps GraphQL ``ID`` to Python ``str``.'