A GraphQL query builder
Project description
Evenstar
Just another GraphQL query builder, but composable!
How to install it?
It's simple, just run: pip install evenstar
GraphQL Syntax Coverage
- Fields
- Arguments
- Aliases
- Fragments
- Operation Name
- Variables
- Directives
- Mutations
- Inline Fragments
Example
apple_field = Field(
name="appleMutation",
alias="apple_mutation_alias",
arguments=Arguments(
{"input": VarSymbol("$apple_input")}
),
children=[
"__typename",
InlineFragment(
on="SomeErrKind",
children=["code", "field", "message"]
),
InlineFragment(
on="SomeAnotherErrKind",
children=["error_code"]
),
],
)
create_banana_field = Field(
name="createBanana",
alias="create_banana",
arguments=Arguments(
{"input": VarSymbol("$create_banana_input")}
),
children=[
"__typename",
"code",
InlineFragment(
on="SomeAnotherErrKind",
children=["error_code"]
),
InlineFragment(
on="Banana",
children=[
"id",
"quality",
Field(
"farm",
children=[
"country",
"town",
"number",
],
),
],
),
],
)
gql_req = Request(
children=[
Mutation(
children=[create_banana_field, apple_field],
variables=[
VarDeclaration("$apple_input", "CreateAppleInput!"),
VarDeclaration("$banana_input", "CreateBananaInput!"),
],
)
],
variables={
"apple_input": {"id": str(uuid4())},
"banana_input": {"id": str(uuid4())},
},
)
print(gql_req.json(indent=2))
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
evenstar-0.2.tar.gz
(4.8 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file evenstar-0.2.tar.gz.
File metadata
- Download URL: evenstar-0.2.tar.gz
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.6.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dd60285e3aac8ef65f14f63315ca0f8c73dbe675cf1a285e49237e4543898180
|
|
| MD5 |
65509ec496cdd61a973bbc45034a5bec
|
|
| BLAKE2b-256 |
b39f88998970aa08acbbbb01ae66c552c4dc836f28f57101893eb5b28a910dc4
|
File details
Details for the file evenstar-0.2-py3-none-any.whl.
File metadata
- Download URL: evenstar-0.2-py3-none-any.whl
- Upload date:
- Size: 7.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.6.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a8f349172ea400dde0e5771183005ce13b36b791e2c854a0c6de42b9c5d11206
|
|
| MD5 |
9c3448aa4f00afa3108314f44abb51bd
|
|
| BLAKE2b-256 |
4de73796c0be25622dcfb8c678046a00b260e7c88c6ff5d37347d3794981b7e7
|