A Python library for making GraphQL requests easier!
Project description
gqlrequests - A Python library for making GraphQL requests easier!
Define GraphQL types in Python, then use them to build queries super easy:
from gqlrequests import GraphQLType
from gqlrequests.primitives import *
# All the primitive types available
# from gqlrequests.primitives import ID
# from gqlrequests.primitives import Int
# from gqlrequests.primitives import Float
# from gqlrequests.primitives import String
# from gqlrequests.primitives import Boolean
class Episode(GraphQLType):
name = String
length = Float
class Character(GraphQLType):
name = String
appearsIn = [Episode]
print(Character())
# type Character {
# appearsIn: [Episode]
# name: String
# }
#
print(Character.query())
# {
# appearsIn {
# name
# length
# }
# name
# }
print(Character.query("name"))
# {
# name
# }
print(Character.query(indent=2)) # Default indent is 4
# {
# appearsIn {
# name
# length
# }
# name
# }
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
gqlrequests-0.0.2.tar.gz
(3.6 kB
view hashes)
Built Distribution
Close
Hashes for gqlrequests-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7a447191c4c16378668e02539505cc3c28ac8a4d2e63984f314e07aa27614109 |
|
MD5 | b7cda9f0e2389a30542523732ed42de4 |
|
BLAKE2b-256 | 3c6662839e6ffa030f73c5f7344b781e45b1292076ec060b1f83ea3c9ff20958 |