graphql-python / Gql

Licence: mit
A GraphQL client in Python

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Gql

Sgqlc
Simple GraphQL Client
Stars: ✭ 286 (-58%)
Mutual labels:  graphql, graphql-client
Graphql Request
Minimal GraphQL client supporting Node and browsers for scripts or simple apps
Stars: ✭ 4,171 (+512.48%)
Mutual labels:  graphql, graphql-client
Apollo Client
🚀  A fully-featured, production ready caching GraphQL client for every UI framework and GraphQL server.
Stars: ✭ 17,070 (+2406.61%)
Mutual labels:  graphql, graphql-client
Nodes
A GraphQL JVM Client - Java, Kotlin, Scala, etc.
Stars: ✭ 276 (-59.47%)
Mutual labels:  graphql, graphql-client
Pup
The Ultimate Boilerplate for Products.
Stars: ✭ 563 (-17.33%)
Mutual labels:  graphql, graphql-client
Apollo Ios
📱  A strongly-typed, caching GraphQL client for iOS, written in Swift.
Stars: ✭ 3,192 (+368.72%)
Mutual labels:  graphql, graphql-client
Elm Graphql
A GraphQL library for Elm
Stars: ✭ 317 (-53.45%)
Mutual labels:  graphql, graphql-client
Graphql Deduplicator
A GraphQL response deduplicator. Removes duplicate entities from the GraphQL response.
Stars: ✭ 258 (-62.11%)
Mutual labels:  graphql, graphql-client
Example Storefront
Example Storefront is Reaction Commerce’s headless ecommerce storefront - Next.js, GraphQL, React. Built using Apollo Client and the commerce-focused React UI components provided in the Storefront Component Library (reactioncommerce/reaction-component-library). It connects with Reaction backend with the GraphQL API.
Stars: ✭ 471 (-30.84%)
Mutual labels:  graphql, graphql-client
Villus
🏎 A tiny and fast GraphQL client for Vue.js
Stars: ✭ 378 (-44.49%)
Mutual labels:  graphql, graphql-client
Babel Blade
(under new management!) ⛸️Solve the Double Declaration problem with inline GraphQL. Babel plugin/macro that works with any GraphQL client!
Stars: ✭ 266 (-60.94%)
Mutual labels:  graphql, graphql-client
Caliban
Functional GraphQL library for Scala
Stars: ✭ 581 (-14.68%)
Mutual labels:  graphql, graphql-client
Swift Graphql
A GraphQL client that lets you forget about GraphQL.
Stars: ✭ 264 (-61.23%)
Mutual labels:  graphql, graphql-client
Morpheus Graphql
Haskell GraphQL Api, Client and Tools
Stars: ✭ 285 (-58.15%)
Mutual labels:  graphql, graphql-client
Grafoo
A GraphQL Client and Toolkit
Stars: ✭ 264 (-61.23%)
Mutual labels:  graphql, graphql-client
Altair
✨⚡️ A beautiful feature-rich GraphQL Client for all platforms.
Stars: ✭ 3,827 (+461.97%)
Mutual labels:  graphql, graphql-client
Neuron
A GraphQL client for Elixir
Stars: ✭ 244 (-64.17%)
Mutual labels:  graphql, graphql-client
Apollo Android
🤖  A strongly-typed, caching GraphQL client for the JVM, Android, and Kotlin multiplatform.
Stars: ✭ 2,949 (+333.04%)
Mutual labels:  graphql, graphql-client
Re Graph
A graphql client for clojurescript and clojure
Stars: ✭ 366 (-46.26%)
Mutual labels:  graphql, graphql-client
Apollo Fetch
🐶 Lightweight GraphQL client that supports middleware and afterware
Stars: ✭ 581 (-14.68%)
Mutual labels:  graphql, graphql-client

GQL

This is a GraphQL client for Python 3.6+. Plays nicely with graphene, graphql-core, graphql-js and any other GraphQL implementation compatible with the spec.

GQL architecture is inspired by React-Relay and Apollo-Client.

WARNING: Please note that the following documentation describes the current version which is currently only available as a pre-release The documentation for the 2.x version compatible with python<3.6 is available in the 2.x branch

GitHub-Actions pyversion pypi Anaconda-Server Badge codecov

Documentation

The complete documentation for GQL can be found at gql.readthedocs.io.

Features

The main features of GQL are:

Installation

WARNING: Please note that the following documentation describes the current version which is currently only available as a pre-release and needs to be installed with

$ pip install --pre gql[all]

NOTE: See also the documentation to install GQL with less extra dependencies

Usage

Basic usage

from gql import gql, Client
from gql.transport.aiohttp import AIOHTTPTransport

# Select your transport with a defined url endpoint
transport = AIOHTTPTransport(url="https://countries.trevorblades.com/")

# Create a GraphQL client using the defined transport
client = Client(transport=transport, fetch_schema_from_transport=True)

# Provide a GraphQL query
query = gql(
    """
    query getContinents {
      continents {
        code
        name
      }
    }
"""
)

# Execute the query on the transport
result = client.execute(query)
print(result)

WARNING: Please note that this basic example won't work if you have an asyncio event loop running. In some python environments (as with Jupyter which uses IPython) an asyncio event loop is created for you. In that case you should use instead the async usage example.

Contributing

See CONTRIBUTING.md

License

MIT License

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].