All Projects → mirumee → Ariadne

mirumee / Ariadne

Licence: bsd-3-clause
Ariadne is a Python library for implementing GraphQL servers using schema-first approach.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Ariadne

Best Of Web Python
🏆 A ranked list of awesome python libraries for web development. Updated weekly.
Stars: ✭ 1,118 (-12.24%)
Mutual labels:  api, graphql, django
Wp Graphql
🚀 GraphQL API for WordPress
Stars: ✭ 3,097 (+143.09%)
Mutual labels:  api, graphql, graphql-server
Storefront Api
Storefront GraphQL API Gateway. Modular architecture. ElasticSearch included. Works great with Magento1, Magento2, Spree, OpenCart, Pimcore and custom backends
Stars: ✭ 180 (-85.87%)
Mutual labels:  api, graphql, graphql-server
Graphql Api For Wp
[READ ONLY] GraphQL API for WordPress
Stars: ✭ 136 (-89.32%)
Mutual labels:  api, graphql, graphql-server
Api Platform
Create REST and GraphQL APIs, scaffold Jamstack webapps, stream changes in real-time.
Stars: ✭ 7,144 (+460.75%)
Mutual labels:  api, graphql, graphql-server
Graphene Django Subscriptions
This package adds support to Subscription's requests and its integration with websockets using Channels package.
Stars: ✭ 173 (-86.42%)
Mutual labels:  api, graphql, django
Blog Service
blog service @nestjs
Stars: ✭ 188 (-85.24%)
Mutual labels:  api, graphql, graphql-server
Pop
Monorepo of the PoP project, including: a server-side component model in PHP, a GraphQL server, a GraphQL API plugin for WordPress, and a website builder
Stars: ✭ 160 (-87.44%)
Mutual labels:  api, graphql, graphql-server
Typegql
Create GraphQL schema with TypeScript classes.
Stars: ✭ 415 (-67.43%)
Mutual labels:  api, graphql, graphql-server
Django Api Domains
A pragmatic styleguide for Django API Projects
Stars: ✭ 365 (-71.35%)
Mutual labels:  api, graphql, django
Djangochannelsgraphqlws
Django Channels based WebSocket GraphQL server with Graphene-like subscriptions
Stars: ✭ 203 (-84.07%)
Mutual labels:  graphql, graphql-server, django
Django Graph Api
Pythonic implementation of the GraphQL specification for the Django Web Framework.
Stars: ✭ 29 (-97.72%)
Mutual labels:  api, graphql, django
Graphql2rest
GraphQL to REST converter: automatically generate a RESTful API from your existing GraphQL API
Stars: ✭ 181 (-85.79%)
Mutual labels:  api, graphql, graphql-server
Wp Graphql Woocommerce
Add WooCommerce support and functionality to your WPGraphQL server
Stars: ✭ 318 (-75.04%)
Mutual labels:  api, graphql, graphql-server
Strawberry
A new GraphQL library for Python 🍓
Stars: ✭ 891 (-30.06%)
Mutual labels:  graphql, graphql-server, django
Omdb Graphql Wrapper
🚀 GraphQL wrapper for the OMDb API
Stars: ✭ 45 (-96.47%)
Mutual labels:  api, graphql, graphql-server
Cookiecutter Django Rest
Build best practiced apis fast with Python3
Stars: ✭ 1,108 (-13.03%)
Mutual labels:  api, django
Locksmith
Want to use GraphQL with Clojure/script but don't want keBab or snake_keys everywhere? Use locksmith to change all the keys!
Stars: ✭ 59 (-95.37%)
Mutual labels:  graphql, graphql-server
Djaoapp
User login, billing, access control as part of a session proxy
Stars: ✭ 61 (-95.21%)
Mutual labels:  api, django
Up
Up focuses on deploying "vanilla" HTTP servers so there's nothing new to learn, just develop with your favorite existing frameworks such as Express, Koa, Django, Golang net/http or others.
Stars: ✭ 8,439 (+562.4%)
Mutual labels:  api, graphql

Ariadne

Documentation Build Status Codecov


Ariadne

Ariadne is a Python library for implementing GraphQL servers.

  • Schema-first: Ariadne enables Python developers to use schema-first approach to the API implementation. This is the leading approach used by the GraphQL community and supported by dozens of frontend and backend developer tools, examples, and learning resources. Ariadne makes all of this immediately available to your and other members of your team.
  • Simple: Ariadne offers small, consistent and easy to memorize API that lets developers focus on business problems, not the boilerplate.
  • Open: Ariadne was designed to be modular and open for customization. If you are missing or unhappy with something, extend or easily swap with your own.

Documentation is available here.

Features

  • Simple, quick to learn and easy to memorize API.
  • Compatibility with GraphQL.js version 14.4.0.
  • Queries, mutations and input types.
  • Asynchronous resolvers and query execution.
  • Subscriptions.
  • Custom scalars, enums and schema directives.
  • Unions and interfaces.
  • File uploads.
  • Defining schema using SDL strings.
  • Loading schema from .graphql files.
  • WSGI middleware for implementing GraphQL in existing sites.
  • Apollo Tracing and OpenTracing extensions for API monitoring.
  • Opt-in automatic resolvers mapping between camelCase and snake_case, and a @convert_kwargs_to_snake_case function decorator for converting camelCase kwargs to snake_case.
  • Build-in simple synchronous dev server for quick GraphQL experimentation and GraphQL Playground.
  • Support for Apollo GraphQL extension for Visual Studio Code.
  • GraphQL syntax validation via gql() helper function. Also provides colorization if Apollo GraphQL extension is installed.
  • No global state or object registry, support for multiple GraphQL APIs in same codebase with explicit type reuse.
  • Support for Apollo Federation.

Installation

Ariadne can be installed with pip:

pip install ariadne

Quickstart

The following example creates an API defining Person type and single query field people returning a list of two persons. It also starts a local dev server with GraphQL Playground available on the http://127.0.0.1:8000 address.

Start by installing uvicorn, an ASGI server we will use to serve the API:

pip install uvicorn

Then create an example.py file for your example application:

from ariadne import ObjectType, QueryType, gql, make_executable_schema
from ariadne.asgi import GraphQL

# Define types using Schema Definition Language (https://graphql.org/learn/schema/)
# Wrapping string in gql function provides validation and better error traceback
type_defs = gql("""
    type Query {
        people: [Person!]!
    }

    type Person {
        firstName: String
        lastName: String
        age: Int
        fullName: String
    }
""")

# Map resolver functions to Query fields using QueryType
query = QueryType()

# Resolvers are simple python functions
@query.field("people")
def resolve_people(*_):
    return [
        {"firstName": "John", "lastName": "Doe", "age": 21},
        {"firstName": "Bob", "lastName": "Boberson", "age": 24},
    ]


# Map resolver functions to custom type fields using ObjectType
person = ObjectType("Person")

@person.field("fullName")
def resolve_person_fullname(person, *_):
    return "%s %s" % (person["firstName"], person["lastName"])

# Create executable GraphQL schema
schema = make_executable_schema(type_defs, query, person)

# Create an ASGI app using the schema, running in debug mode
app = GraphQL(schema, debug=True)

Finally run the server:

uvicorn example:app

For more guides and examples, please see the documentation.

Contributing

We are welcoming contributions to Ariadne! If you've found a bug or issue, feel free to use GitHub issues. If you have any questions or feedback, don't hesitate to catch us on Spectrum.

For guidance and instructions, please see CONTRIBUTING.md.

Website and the docs have their own GitHub repository: mirumee/ariadne-website

Also make sure you follow @AriadneGraphQL on Twitter for latest updates, news and random musings!

Crafted with ❤️ by Mirumee Software [email protected]

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].