GraphQL framework for Python

Overview

Graphene Logo Graphene Build Status PyPI version Coverage Status

💬 Join the community on Slack

We are looking for contributors! Please check the ROADMAP to see how you can help ❤️


The below readme is the documentation for the dev (prerelease) version of Graphene. To view the documentation for the latest stable Graphene version go to the v2 docs


Introduction

Graphene is an opinionated Python library for building GraphQL schemas/types fast and easily.

  • Easy to use: Graphene helps you use GraphQL in Python without effort.
  • Relay: Graphene has builtin support for Relay.
  • Data agnostic: Graphene supports any kind of data source: SQL (Django, SQLAlchemy), NoSQL, custom Python objects, etc. We believe that by providing a complete API you could plug Graphene anywhere your data lives and make your data available through GraphQL.

Integrations

Graphene has multiple integrations with different frameworks:

integration Package
Django graphene-django
SQLAlchemy graphene-sqlalchemy
Google App Engine graphene-gae

Also, Graphene is fully compatible with the GraphQL spec, working seamlessly with all GraphQL clients, such as Relay, Apollo and gql.

Installation

For instaling graphene, just run this command in your shell

pip install "graphene>=2.0"

Examples

Here is one example for you to get started:

import graphene

class Query(graphene.ObjectType):
    hello = graphene.String(description='A typical hello world')

    def resolve_hello(self, info):
        return 'World'

schema = graphene.Schema(query=Query)

Then Querying graphene.Schema is as simple as:

query = '''
    query SayHello {
      hello
    }
'''
result = schema.execute(query)

If you want to learn even more, you can also check the following examples:

Documentation

Documentation and links to additional resources are available at https://docs.graphene-python.org/en/latest/

Contributing

After cloning this repo, create a virtualenv and ensure dependencies are installed by running:

virtualenv venv
source venv/bin/activate
pip install -e ".[test]"

Well-written tests and maintaining good test coverage is important to this project. While developing, run new and existing tests with:

py.test graphene/relay/tests/test_node.py # Single file
py.test graphene/relay # All tests in directory

Add the -s flag if you have introduced breakpoints into the code for debugging. Add the -v ("verbose") flag to get more detailed test output. For even more detailed output, use -vv. Check out the pytest documentation for more options and test running controls.

You can also run the benchmarks with:

py.test graphene --benchmark-only

Graphene supports several versions of Python. To make sure that changes do not break compatibility with any of those versions, we use tox to create virtualenvs for each Python version and run tests with that version. To run against all Python versions defined in the tox.ini config file, just run:

tox

If you wish to run against a specific version defined in the tox.ini file:

tox -e py36

Tox can only use whatever versions of Python are installed on your system. When you create a pull request, Travis will also be running the same tests and report the results, so there is no need for potential contributors to try to install every single version of Python on their own system ahead of time. We appreciate opening issues and pull requests to make graphene even more stable & useful!

Building Documentation

The documentation is generated using the excellent Sphinx and a custom theme.

An HTML version of the documentation is produced by running:

make docs
Comments
  • Graphene real-time subscriptions and Apollo client graphql integration

    Graphene real-time subscriptions and Apollo client graphql integration

    Hello @syrusakbary.

    Thanks for all your hard work on graphene and graphql-python. Awesome library!!

    I posted this on #393 earlier this week...reposting here so it's easier to discover.

    I implemented a port of the apollo graphql subscriptions modules (graphql-subscriptions and subscriptions-transport-ws) for graphene / python. They work w/ apollo-client.

    It is here.

    Same basic api as the Apollo modules. It is still very rough...but works so far, based on my limited internal testing. Uses redis-py, gevent-websockets, and syrusakbary/promises. I was going to add a simple example app, setup.py for easier install, and more info to the readme w/ the API, in the next few days. A brief example is below. Only works on python2 for now. My plan is to start working on tests as well. I figured I'd go ahead and share in this early stage in case anybody is interested...

    I'm very new to open source, so any critiques or pull requests are welcome.

    Simple example:

    Server (using Flask and Flask-Sockets):

    from flask import Flask
    from flask_sqlalchemy import SQLAlchemy
    from flask_sockets import Sockets
    
    from .subscription_manager import SubscriptionManager, RedisPubsub
    from .subscription_transport_ws import ApolloSubscriptionServer
    
    app = Flask(__name__)
    sockets = Sockets(app)
    pubsub = RedisPubsub()
    schema = graphene.Schema(
        query=Query,
        mutation=Mutation,
        subscription=Subscription
    )
    subscription_mgr = SubscriptionManager(schema, pubsub)
    
    @sockets.route('/socket')
    def socket_channel(websocket):
        subscription_server = ApolloSubscriptionServer(subscription_mgr, websocket)
        subscription_server.handle()
        return []
    
    if __name__ == "__main__":
        from geventwebsocket import WebSocketServer
    
        server = WebSocketServer(('', 5000), app)
        print '  Serving at host 0.0.0.0:5000...\n'
        server.serve_forever()
    

    Of course on the server you have to "publish" each time you have a mutation (in this case to a redis channel). That could look something like this (using graphene / sql-alchemy):

    class Subscription(graphene.ObjectType):
        users = graphene_sqlalchemy.SQLAlchemyConnectionField(
            User,
            active=graphene.Boolean()
        )
    
        def resolve_users(self, args, context, info):
            query = User.get_query(context)
            return query.filter_by(id=info.root_value.get('id'))
    
    class AddUser(graphene.ClientIDMutation):
    
        class Input:
            username = graphene.String(required=True)
            email = graphene.String()
    
        ok = graphene.Boolean()
        user = graphene.Field(lambda: User)
    
        @classmethod
        def mutate_and_get_payload(cls, args, context, info):
            _input = args.copy()
            del _input['clientMutationId']
            new_user = UserModel(**_input)
            db.session.add(new_user)
            db.session.commit()
            ok = True
            if pubsub.subscriptions:
                pubsub.publish('users', new_user.as_dict())
            return AddUser(ok=ok, user=new_user)
    

    Client (using react-apollo client):

    import React from 'react'
    import ReactDOM from 'react-dom'
    import { graphql, ApolloProvider } from 'react-apollo'
    import gql from 'graphql-tag'
    import ApolloClient, { createNetworkInterface } from 'apollo-client'
    import { SubscriptionClient, addGraphQLSubscriptions } from 'subscriptions-transport-ws'
    
    import ChatApp from './screens/ChatApp'
    import ListBox from '../components/ListBox'
    
    const SUBSCRIPTION_QUERY = gql`
      subscription newUsers {
        users(active: true) {
          edges {
            node {
              id
              username
            }
          }
        }
      }
    `
    
    const LIST_BOX_QUERY = gql`
      query AllUsers {
        users(active: true) {
          edges {
            node {
              id
              username
            }
          }
        }
      }
    `
    
    class ChatListBox extends React.Component {
    
      componentWillReceiveProps(newProps) {
        if (!newProps.data.loading) {
          if (this.subscription) {
            return
          }
          this.subscription = newProps.data.subscribeToMore({
            document: SUBSCRIPTION_QUERY,
            updateQuery: (previousResult, {subscriptionData}) => {
              const newUser = subscriptionData.data.users.edges
              const newResult = {
                users: {
                  edges: [
                    ...previousResult.users.edges,
                    ...newUser
                  ]
                }
              }
              return newResult
            },
            onError: (err) => console.error(err)
          })
        }
      }
    
      render() {
        return <ListBox data={this.props.data} />
      }
    }
    
    const ChatListBoxWithData = graphql(LIST_BOX_QUERY)(ChatListBox)
    
    export default ChatListBoxWithData
    
    const networkInterface = createNetworkInterface({
      uri: 'http://localhost:5000/graphql'
    })
    
    const wsClient = new SubscriptionClient(`ws://localhost:5000/socket`, {
      reconnect: true
    })
    
    const networkInterfaceWithSubscriptions = addGraphQLSubscriptions(
      networkInterface,
      wsClient,
    )
    
    const client = new ApolloClient({
      dataIdFromObject: o => o.id,
      networkInterface: networkInterfaceWithSubscriptions
    })
    
    ReactDOM.render(
      <ApolloProvider client={client}>
        <ChatApp />
      </ApolloProvider>,
      document.getElementById('root')
    )
    
    wontfix 
    opened by hballard 83
  • ☂️ Graphene v3

    ☂️ Graphene v3

    This issue is to track v3 of Graphene which will contain some breaking changes.

    Breaking changes

    • Upgrade to graphql-core to v3 which brings feature parity with GraphQL.js v14.6.0
    • Drop support for Python v2
    • Schema type changes
    • "Backends" have been removed
    • Switch arguments from type to type_ since type is a builtin: https://github.com/graphql-python/graphene/pull/738
    • Upgrade to graphql-core v.3.1 which corresponds to GraphQL.js v15 (will be released soon).
    • Change enum behaviour: https://github.com/graphql-python/graphene/pull/1153
    • Remove to_const function

    TODO

    • [x] Write up some proper release notes: https://github.com/graphql-python/graphene/wiki/v3-release-notes
    • [x] Merge https://github.com/graphql-python/graphene/pull/1111
    • [x] Switch arguments from type to type_ since type is a builtin: https://github.com/graphql-python/graphene/pull/738
    • [x] Remove to_const function: #1212
    • [x] Change enum behaviour: https://github.com/graphql-python/graphene/pull/1153
    • [x] Set minimum graphql-core version to v3.1 https://github.com/graphql-python/graphene/pull/1215
    • [x] Upgrade graphene-sqlalchemy to v3 WIP
    • [x] Upgrade graphene-mongo to v3 WIP
    opened by jkimbo 82
  • Maintenance Plan

    Maintenance Plan

    Maintenance

    We need to start working on a Maintenance plan for Graphene and it's sub-projects: graphene-django, graphene-sqlalchemy, graphql-core, graphql-core-next ... .

    Why?

    Right now my main focus has diverged from Graphene.

    Because of that but also because my main focus is now on @wasmerio (which takes most of my time), we should plan a proper way to maintain Graphene in the long term without being blocked by my explicit approval, so it keeps growing at a healthy pace from contributors willing to take the time to make the project shine.

    How we will do it?

    Few months ago I've created an internal Slack channel, with people from Yelp, Reddit and other companies to have a direct way of communication with them. I would love to invite more people to join this channel, so we can discuss the maintainance plan in a realtime fashion. If you are interested in joining, please write your email as a comment on this issue :)

    Ideal Solution

    Ideally, we will form a committee of experts that have the knowledge and insight into what Graphene needs in both the short and long term. Done in a way that is not skewed on doing what only one or two companies need, but rather to focus on the community and the global needs.

    I do like the way Django and the PSF are doing this, but more ideas will also be more than welcome!

    At the same time, because all this years have gave me a lot of insight, I'll keep beign the belevolent dictator for Graphene, but my role will be more on the back side rather than in the front.

    Looking forward to hearing your thoughts! :)

    opened by syrusakbary 73
  • Added support for subscription

    Added support for subscription

    This is my first ever pull request so please be kind :)

    This adds subscription functionality to v3 by introducing a subscribe method to the schema.

    import asyncio
    from datetime import datetime
    from graphene import ObjectType, String, Schema, Field
    
    # All schema must contain a query.
    class Query(ObjectType):
        hello = String()
    
        def resolve_hello(root, info):
            return 'Hello, world!'
    
    class Subscription(ObjectType):
        time_of_day = Field(String)
    
        async def subscribe_time_of_day(root, info):
            while True:
                yield { 'time_of_day': datetime.now().isoformat()}
                await asyncio.sleep(1)
    
    SCHEMA = Schema(query=Query, subscription=Subscription)
    
    async def main(schema):
    
        subscription = 'subscription { timeOfDay }'
        result = await schema.subscribe(subscription)
        async for item in result:
            print(item.data['timeOfDay'])
    
    asyncio.run(main(SCHEMA))
    
    opened by rob-blackbourn 38
  • Apollo Optics Integration

    Apollo Optics Integration

    opened by chaffeqa 38
  • Django integration implementation

    Django integration implementation

    I'm creating this (work in progress) pull request given that #48 seems to have developed a sensible solution.

    This pull request currently represents the contents of the original proposed Gist which can be found at: https://gist.github.com/adamcharnock/ad051b419d4c613d40fe

    Todo:

    • [x] Create a GlobalIDFilter and GlobalIDField field
    • ~~Consider allowing the new resolvers to be used as function decorators (as per @syrusakbary suggestion)~~
    • [x] Allow FilterSet classes to be created dynamically created upon passing a fields argument to DjangoFilterConnectionField (as per @syrusakbary suggestion)
    • [x] Write tests
    • [x] django-filter should be an optional package
    • [x] Filtering on to-many fields
    • [x] Change order parameter name to order rather than o
    • [x] Filtering information should be stored on the destination node's Meta class
    • [x] Filtering should be available on nodes without having to explicitly define the fields
    • ~~Filtering should be enabled explicitly (i.e. via Django setting) rather than implicit (via presence of django-filter).~~
    • [x] Documentation

    Useful, but perhaps for a second phase of development:

    • [ ] Support for lazy loading of related nodes
    • [ ] Loading of app-level query classes
    opened by adamcharnock 35
  • Error handling

    Error handling

    We have decided to approach error handling like suggested in many blogs, by having errors defined as fields rather than raising exceptions.

    The thing with this is that we need to make sure we catch every exception that we want to handle and somehow keep track of them to be able to inform them.

    So we came up with:

    
    class BaseObjectType(graphene.ObjectType):
    
        class Meta:
            abstract = True
    
        @classmethod
        def __init_subclass_with_meta__(
            cls,
            interfaces=(),
            possible_types=(),
            default_resolver=None,
            _meta=None,
            **options
        ):
            super().__init_subclass_with_meta__(
                interfaces, possible_types, default_resolver, _meta, **options)
    
            for f in cls._meta.fields:
                if f in ['errors']:
                    continue
    
                resolver_name = "resolve_{}".format(f)
                if hasattr(cls, resolver_name):
                    setattr(cls, resolver_name, catch_errors(getattr(cls, resolver_name)))
    
    
    class BaseResponse(BaseObjectType):
    
        class Meta:
            abstract = True
    
        errors = graphene.String()
    
        @staticmethod
        def resolve_errors(root, info, **kwargs):
            operation_name = info.path[0]
            error_key = f"{operation_name}_errors"
       
            if not root.errors and error_key in info.context.errors:
                root.errors = ",".join(info.context.errors[error_key])
    
            return root.errors
    

    catch_errors just populates info.context.errors for each operation

    While implementing this approach for error handling I have also found an issue when resolving the error field. I have a base class that extends ObjectType by iterating over the resolvers and wrapping them to n catch any errors and setting an errors dict in the info.context.

    Problem is that when resolving a type field that throws an exception, I do catch it and set the error, but the error field was already processed/resolved. Is there a way to force a particular field to be processed at the end or to force it to update? I need to make sure every resolver runs before the error field is resolver so I make sure all errors are caught.

    question 
    opened by sebastiandev 31
  • Saving null value for nullable fields

    Saving null value for nullable fields

    I had a problem saving the null values in the mutations. Is it possible to implement functionality to get_argument_values function could distinguish passed null value and not passed value? I think it can be implemented similar to the executor.ececute_fields using Undefined.

    opened by prokofiev 28
  • Add Documentation for Relay Edge implementation

    Add Documentation for Relay Edge implementation

    In the Relay mutation docs, performing RANGE_ADD requires that the new edge created by the mutation is provided in the payload.

    I do not know how to provide the correct cursor/Edge construction within the relay.ClientIDMutation subclass.

    The following code I wrote:

    new_object_edge = graphene.Field('ObjectEdge')

    I believed would solve my issue, with a proper resolve_new_object_edge(...) resolver.

    However, my resolver cannot reference the relay.ConnectionField that is specified on one of the other object types in my mutation, since it only has the context of my (in this case, Django) objects.

    I experimented with relay.Edge.for_node(SomeObjectType) as well but all of the solutions I have tried so far modify the schema correctly but cannot return the appropriate Edge.

    The implementation of this scenario in javascript can be found here in the Relay examples directory.

    Any idea of a best approach? I can take this question to stack overflow, but felt that people using Relay & Graphene would enjoy seeing an example solution in the docs.

    question work in progress 
    opened by gregziegan 28
  • Protection against malicious queries

    Protection against malicious queries

    Hey. I was looking for a lot of information on how to protect against malicious requests, and as a result I found several common approaches:

    • query cost or resource limitations (https://developer.github.com/v4/guides/resource-limitations/)
    • limiting query depth (https://sangria-graphql.org/learn/#limiting-query-depth)
    • query whitelisting
    • hide introspection for production mode (this is not common solution, but sounds good)

    All this approaches we can implement by meddleware and custom backend. But it will be cool if this solution is out of the box.

    Also, graphene don't have information about security into the documentation.

    ps: I can try to help, but if u have no reason why this is a bad idea.

    🙋 help wanted question 
    opened by Arfey 26
  • Authorization for Node queries

    Authorization for Node queries

    Hi

    It would be helpful to have a standard way to do authorization in graphene, specifically for Node Relay queries. In non-Node queries it's easy enough to enforce authorization in resolve_XXX (mentioned in https://github.com/graphql-python/graphene/issues/94) but for Node we need a hook to inject type-specific and argument-specific checks.

    We're most using @ekampf 's graphene-gae so in theory we could inherit and override NdbObjectType.get_node but that would require doing a similar override in for non-ndb types.

    Any plans to support authorization directly in graphene?

    wontfix 
    opened by barakcoh 24
  • remove leading whitespaces in multi-line descriptions

    remove leading whitespaces in multi-line descriptions

    Currently Scalar types and Field types pass description without touching it which is causing the issue of inconsistent white spaces in the case of multi-line descriptions when parsed by federation services.

    Addressing issue #1489

    opened by firaskafri 1
  • Leading white spaces in description casuing issues

    Leading white spaces in description casuing issues

    Note: for support questions, please use stackoverflow. This repository's issues are reserved for feature requests and bug reports.

    • What is the current behavior? Currently Scalar types and Field types pass description without touching it which is causing the issue of inconsistent white spaces in the case of multi-line descriptions when parsed by federation services.

    • If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via a github repo, https://repl.it or similar.

    1 - Add a multi-line description argument to any Scalar or Field 2 - Generate schema 3 - Try to build a service schema using graphene-federation 4 - Connect the service to a federation gateway

    • What is the expected behavior?

    Leading white spaces in multi-line description must be stripped

    • What is the motivation / use case for changing the behavior? Building a federated gateway

    • Please tell us about your environment:

      • Version:
      • Platform:
    • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow)

    🐛 bug 
    opened by firaskafri 1
  • Add `subscribe` to Field

    Add `subscribe` to Field

    This PR makes possible to use external functions as subscriptions, not just subsctibe_field.

    Before:

    class Query(ObjectType):
        hello = String()
    
        def resolve_hello(root, info):
            return "Hello, world!"
    
    class Subscription(ObjectType):
    
        count_to_ten = Field(Int)
    
        async def subscribe_count_to_ten(root, info): # <- you can only subscribe...
            for count in range(1, 11):
                yield count
    
    schema = Schema(query=Query, subscription=Subscription)
    

    After:

    class Query(ObjectType):
        hello = String()
    
        def resolve_hello(root, info):
            return "Hello, world!"
    
    
    async def subscribe_count_to_five(root, info):
        for count in range(1, 6):
            yield count
    
    
    class Subscription(ObjectType):
    
        count_to_ten = Field(Int)
    
        async def subscribe_count_to_ten(root, info):
            for count in range(1, 11):
                yield count
    
        count_to_five = Field(Int, subscribe=subscribe_count_to_five) # <- Can use external function
    
    schema = Schema(query=Query, subscription=Subscription)
    

    At the same time, the permission function directly in the class has priority over Field.subscribe.

    opened by Luferov 1
  • Thanks for Thanks for GraphQL Python Roadmap

    Thanks for Thanks for GraphQL Python Roadmap

    Hello, thanks for Thanks for GraphQL Python Roadmap

    I see that this project is the most alive in https://github.com/graphql-python

    I use python as GraphQL client and server in my projects and I created the package for pydantic data-model generation from some GraphQL schema and for queries and mutations generation: https://github.com/denisart/graphql2python Docs: https://denisart.github.io/graphql2python/

    Queries generation examples: https://github.com/denisart/graphql-query Data-model generation examples: https://denisart.github.io/graphql2python/model.html Using with gql: https://denisart.github.io/graphql2python/gql.html

    This package so far has few settings. This will be fixed in future releases. For example:

    • custom templates for render of data-model (your pydantic style or other packages (https://github.com/lidatong/dataclasses-json, ...));
    • custom input for output file;
    • load GraphQL as like in https://the-guild.dev/graphql/codegen/docs/config-reference/schema-field;
    • custom base class;
    • and more;

    I hope that graphql2python can be useful to you and the python GraphQL community.

    ✨ enhancement 
    opened by denisart 0
  • Allow configuring schema.introspect

    Allow configuring schema.introspect

    Schema.introspect should implement some mechanism to modify the introspection query settings (see graphql.utilities.get_introspection_query). A use case for this is the recently implemented deprecated argument and input fields support (#1472). These are by default excluded from the introspection query.

    ✨ enhancement 
    opened by erikwrede 0
  • Changed InputObjectType's default builder-from-dict argument to be `Undefined` instead of `None` (or else we can't catch

    Changed InputObjectType's default builder-from-dict argument to be `Undefined` instead of `None` (or else we can't catch "null" inputs in InputObjectTypes, as both would coerce to `None`)

    This pull request aims to fix a shortcoming in the InputObjectTypes' implementation that makes it unable to differentiate an incoming undefined value from an intentional null.

    The problem lies in the way the InputObjectType is constructed from the incoming parameter dictionary:

    class InputObjectTypeContainer(dict, BaseType):
        class Meta:
            abstract = True
    
        def __init__(self, *args, **kwargs):
            dict.__init__(self, *args, **kwargs)
            for key in self._meta.fields:
                setattr(self, key, self.get(key, None)) # <-- Ambiguous default value
    
        def __init_subclass__(cls, *args, **kwargs):
            pass
    

    With None as that self.get's default value, we are unable to differentiate between someone passing an intentional null (None) in an optional field. This PR refactors that default to point to Undefined, aligning closely with the GraphQL Spec.

    This change is a potential breaking change for resolvers, so I've implemented a function called set_input_object_type_default_value that allows one to set the desired default value for InputObjectTypes. Calling set_input_object_type_default_value(graphql.Undefined) activates the new behavior in your codebase. This function should be called before your InputObjectTypes are defined.

    The final container type then became:

    _INPUT_OBJECT_TYPE_DEFAULT_VALUE = None
    
    def set_input_object_type_default_value(default_value):
        global _INPUT_OBJECT_TYPE_DEFAULT_VALUE
        _INPUT_OBJECT_TYPE_DEFAULT_VALUE = default_value
    
    class InputObjectTypeContainer(dict, BaseType):  # type: ignore
        ...
        def __init__(self, *args, **kwargs):
            dict.__init__(self, *args, **kwargs)
            for key in self._meta.fields:
                setattr(self, key, self.get(key, _INPUT_OBJECT_TYPE_DEFAULT_VALUE))
        ...
    
    opened by flipbit03 4
Releases(v3.2.1)
  • v3.2.1(Dec 11, 2022)

    What's Changed

    Non-required InputFields and Arguments can now be marked as deprecated by passing the deprecation_reason keyword argument to the constructor.

    • Complete deprecated fields and arguments support by @vhutov in https://github.com/graphql-python/graphene/pull/1472

    New Contributors

    • @vhutov made their first contribution in https://github.com/graphql-python/graphene/pull/1472

    Full Changelog: https://github.com/graphql-python/graphene/compare/v3.2.0...v3.2.1

    Source code(tar.gz)
    Source code(zip)
  • v3.2.0(Dec 9, 2022)

    What's Changed

    Support for custom global IDs in relay.Node

    The global ID type of a Node can now be customized:

    class CustomNode(Node):
        class Meta:
            global_id_type = CustomGlobalIDType
    
    
    class User(ObjectType):
        class Meta:
            interfaces = [CustomNode]
    
        name = String()
    
        @classmethod
        def get_node(cls, _type, _id):
            return self.users[_id]
    
    Available Types

    Currently, the following types are available:

    • DefaultGlobalIDType: Default global ID type: base64 encoded version of ": ". (Previously the only option) Scalar: ID
    • SimpleGlobalIDType: Simple global ID type: simply the id of the object. Scalar: ID
    • UUIDGlobalIDType: UUID global ID type. Scalar: UUID
    Customization

    To create a custom global type, BaseGlobalIDType must be extended:

    
    class CustomGlobalIDType(BaseGlobalIDType):
    
        graphene_type = CustomScalar
    
        @classmethod
        def resolve_global_id(cls, info, global_id):
            _type = custom_get_type_from_global_id(global_id)
            return _type, global_id
    
        @classmethod
        def to_global_id(cls, _type, _id):
            return _id
    

    graphene_type specifies the type of scalar to be used in the schema. Remember, that if you're using ID as a scalar, you might need to deserialize your custom global ID first!

    Relevant PR:

    • feat: Add support for custom global (Issue #1276) by @tcleonard in https://github.com/graphql-python/graphene/pull/1428

    Fixes & Improvements:

    • Regression fix: (graphene 2->3) ObjectTypes can be copied again #1333 by @keu210
    • Fix: Enums can now have members called description: #1478 by @mike-roberts-healx
    • Enums are now hashable: #1461 by @bkad
    • Enums are now iterable: #1473 by @rgroothuijsen
    • Dependency on unused promise Library was removed: #1476 by @mike-roberts-healx
    • Docs improvements by @rgroothuijsen

    All Changes

    • feat: Add support for custom global (Issue #1276) by @tcleonard in https://github.com/graphql-python/graphene/pull/1428
    • Add copy function for GrapheneGraphQLType by @keu210 in https://github.com/graphql-python/graphene/pull/1463
    • hashable Enum by @bkad in https://github.com/graphql-python/graphene/pull/1461
    • Clarify execution order in middleware docs by @rgroothuijsen in https://github.com/graphql-python/graphene/pull/1475
    • fix: MyPy findings due to a mypy version upgrade were corrected by @erikwrede in https://github.com/graphql-python/graphene/pull/1477
    • Disambiguate argument name in quickstart docs by @rgroothuijsen in https://github.com/graphql-python/graphene/pull/1474
    • Make Graphene enums iterable like Python enums by @rgroothuijsen in https://github.com/graphql-python/graphene/pull/1473
    • Remove unnecessary dependency on 'promise' library by @mike-roberts-healx in https://github.com/graphql-python/graphene/pull/1476
    • Do not interpret Enum members called 'description' as description properties by @mike-roberts-healx in https://github.com/graphql-python/graphene/pull/1478

    New Contributors

    • @keu210 made their first contribution in https://github.com/graphql-python/graphene/pull/1463
    • @bkad made their first contribution in https://github.com/graphql-python/graphene/pull/1461
    • @rgroothuijsen made their first contribution in https://github.com/graphql-python/graphene/pull/1475
    • @mike-roberts-healx made their first contribution in https://github.com/graphql-python/graphene/pull/1476

    Full Changelog: https://github.com/graphql-python/graphene/compare/v3.1.1...v3.2.0

    Source code(tar.gz)
    Source code(zip)
  • v3.1.1(Sep 8, 2022)

    What's changed

    Dataloader

    Graphene now includes an updated version of aiodataloader by Syrus Akbary under graphene.utils.dataloader due to inactivity of the old repository. The update fixes an issue some users experienced when trying to use dataloader in conjunction with pytest (https://github.com/syrusakbary/aiodataloader/issues/13). Further contributions and updates to dataloader in this repo are welcome!

    Enums

    A custom typename can now be added when using from_enum:

        from enum import Enum as PyEnum
    
        class Color(PyEnum):
            RED = 1
            YELLOW = 2
            BLUE = 3
    
        GColor = Enum.from_enum(Color, description="original colors")
        UniqueGColor = Enum.from_enum(
            Color, name="UniqueColor", description="unique colors"
        )
    
    type Query {
        color: Color!
        uniqueColor: UniqueColor!
    }
    """original colors"""
    enum Color {
        RED
        YELLOW
        BLUE
    }
    """unique colors"""
    enum UniqueColor {
        RED
        YELLOW
        BLUE
    }
    
    • feat: add ability to provide a type name to enum when using from_enum by @tcleonard in https://github.com/graphql-python/graphene/pull/1430

    Interfaces

    Interfaces extending interfaces is now supported!

        class FooInterface(Interface):
            foo = String()
    
        class BarInterface(Interface):
            class Meta:
                interfaces = [FooInterface]
    
            foo = String()
            bar = String()
    
    interface FooInterface {
      foo: String
    }
    
    interface BarInterface implements FooInterface {
      foo: String
      bar: String
    }
    
    • Add support for interfaces on interfaces by @AlecRosenbaum in https://github.com/graphql-python/graphene/pull/1304

    Thank you to everyone that contributed to this release!

    Other Changes

    • Fix typo in union comments by @ramonwenger in https://github.com/graphql-python/graphene/pull/1424
    • Add Codecov to github actions by @erikwrede in https://github.com/graphql-python/graphene/pull/1431
    • docs: Fix a few typos by @timgates42 in https://github.com/graphql-python/graphene/pull/1437
    • Highlight .get in backticks by @RJ722 in https://github.com/graphql-python/graphene/pull/1402
    • Add support for interfaces on interfaces by @AlecRosenbaum in https://github.com/graphql-python/graphene/pull/1304
    • Update Dataloader docs [Waiting for Graphene v3 to be live] by @jkimbo in https://github.com/graphql-python/graphene/pull/1190
    • Avoid ambiguity in graphene.Mutation docstring [documentation] by @belkka in https://github.com/graphql-python/graphene/pull/1381
    • Issue #1413 fix invalid input type by @tcleonard in https://github.com/graphql-python/graphene/pull/1414
    • Delete coveralls.yml by @erikwrede in https://github.com/graphql-python/graphene/pull/1442
    • fix: use install instead of instal for consistency by @karmingc in https://github.com/graphql-python/graphene/pull/1444
    • Update quickstart.rst by @alimcmaster1 in https://github.com/graphql-python/graphene/pull/1407
    • Update pre-commit hooks by @ulgens in https://github.com/graphql-python/graphene/pull/1447
    • fix: update ariadne url to the new docs by @DrewHoo in https://github.com/graphql-python/graphene/pull/1370
    • Add Python 3.11 release candidate 1 to the testing by @cclauss in https://github.com/graphql-python/graphene/pull/1450
    • Remove duplicate flake8 call in tox, it's covered by pre-commit by @ulgens in https://github.com/graphql-python/graphene/pull/1448
    • Fix BigInt export by @erikwrede in https://github.com/graphql-python/graphene/pull/1456
    • Upgrade base Python version to 3.10 by @ulgens in https://github.com/graphql-python/graphene/pull/1449
    • Upgrade GitHub Actions by @cclauss in https://github.com/graphql-python/graphene/pull/1457
    • Vendor DataLoader from aiodataloader and move get_event_loop() out of __init__ function. by @flipbit03 in https://github.com/graphql-python/graphene/pull/1459

    New Contributors

    • @ramonwenger made their first contribution in https://github.com/graphql-python/graphene/pull/1424
    • @timgates42 made their first contribution in https://github.com/graphql-python/graphene/pull/1437
    • @RJ722 made their first contribution in https://github.com/graphql-python/graphene/pull/1402
    • @belkka made their first contribution in https://github.com/graphql-python/graphene/pull/1381
    • @karmingc made their first contribution in https://github.com/graphql-python/graphene/pull/1444
    • @alimcmaster1 made their first contribution in https://github.com/graphql-python/graphene/pull/1407
    • @ulgens made their first contribution in https://github.com/graphql-python/graphene/pull/1447
    • @DrewHoo made their first contribution in https://github.com/graphql-python/graphene/pull/1370
    • @flipbit03 made their first contribution in https://github.com/graphql-python/graphene/pull/1459

    Full Changelog: https://github.com/graphql-python/graphene/compare/v3.1.0...v3.1.1

    Source code(tar.gz)
    Source code(zip)
  • v3.1.0(May 30, 2022)

    What's Changed

    • Various spelling and grammar fixes for the documentation. by @justinrmiller in https://github.com/graphql-python/graphene/pull/1324
    • Chore: Refactor Multi Expression Code ✨ by @yezz123 in https://github.com/graphql-python/graphene/pull/1387
    • Add Python 3.9 and 3.10 to the test matrix by @Cito in https://github.com/graphql-python/graphene/pull/1401
    • fix UPGRADE-v2.0.md by @conao3 in https://github.com/graphql-python/graphene/pull/1405
    • fix: default value for argument should be Undefined (Issue #1394) by @tcleonard in https://github.com/graphql-python/graphene/pull/1412
    • fix: add default param _variables to parse_literal #1419 by @fugal-dy in https://github.com/graphql-python/graphene/pull/1420
    • Make Graphene compatible with GraphQL-Core 3.2 by @Cito in https://github.com/graphql-python/graphene/pull/1421

    New Contributors

    • @justinrmiller made their first contribution in https://github.com/graphql-python/graphene/pull/1324
    • @yezz123 made their first contribution in https://github.com/graphql-python/graphene/pull/1387
    • @conao3 made their first contribution in https://github.com/graphql-python/graphene/pull/1405
    • @fugal-dy made their first contribution in https://github.com/graphql-python/graphene/pull/1420

    Full Changelog: https://github.com/graphql-python/graphene/compare/v3.0.0...v3.1.0

    Source code(tar.gz)
    Source code(zip)
  • v3.0.0(Nov 13, 2021)

    Release notes

    The full release notes including an upgrade guide can be found here: https://github.com/graphql-python/graphene/wiki/v3-release-notes

    What's Changed

    • Graphene v3 following v3 graphql-core by @mvanlonden in https://github.com/graphql-python/graphene/pull/1048
    • Fix typos by @minho42 in https://github.com/graphql-python/graphene/pull/1066
    • Remove AbstractType by @jkimbo in https://github.com/graphql-python/graphene/pull/1053
    • Propagate arguments of relay.NodeField to Field by @tdiam in https://github.com/graphql-python/graphene/pull/1036
    • Fix typo in execute.rst by @TheMelter in https://github.com/graphql-python/graphene/pull/1115
    • Increase the allowed version of aniso8601 by @ymoch in https://github.com/graphql-python/graphene/pull/1072
    • Update quickstart.rst by @ibhlool7 in https://github.com/graphql-python/graphene/pull/1090
    • Add file uploading docs by @jkimbo in https://github.com/graphql-python/graphene/pull/1084
    • Fix objecttypes DefaultResolver example (#1087) by @tompao in https://github.com/graphql-python/graphene/pull/1088
    • Fix tests by @jkimbo in https://github.com/graphql-python/graphene/pull/1119
    • Fix example code by @jkimbo in https://github.com/graphql-python/graphene/pull/1120
    • Update readme by @jkimbo in https://github.com/graphql-python/graphene/pull/1130
    • Use unidecode to handle unicode characters in constant names by @henrythor in https://github.com/graphql-python/graphene/pull/1080
    • The default_value of InputField should be INVALID by @ganwell in https://github.com/graphql-python/graphene/pull/1111
    • Add a helpful message to when a global_id fails to parse. by @allen-munsch in https://github.com/graphql-python/graphene/pull/1074
    • fix example middleware class in docs by @dsanders11 in https://github.com/graphql-python/graphene/pull/1134
    • fix typo in class 'Interface' by @JMmmmuu in https://github.com/graphql-python/graphene/pull/1135
    • Fix example query in quickstart doc by @ko-lem in https://github.com/graphql-python/graphene/pull/1139
    • Fixed import causing Graphene v3 to crash by @jaydenwindle in https://github.com/graphql-python/graphene/pull/1143
    • Replace INVALID with Undefined by @jkimbo in https://github.com/graphql-python/graphene/pull/1146
    • Added support for subscription by @rob-blackbourn in https://github.com/graphql-python/graphene/pull/1107
    • Remove subclass polyfill by @syrusakbary in https://github.com/graphql-python/graphene/pull/1156
    • Updated all str.format(…) to f-strings by @syrusakbary in https://github.com/graphql-python/graphene/pull/1158
    • Fixed examples, make root object explicit inside resolvers and mutate by @hzlmn in https://github.com/graphql-python/graphene/pull/1159
    • Remove unused function by @jkimbo in https://github.com/graphql-python/graphene/pull/1160
    • Add some more tests for Interface by @jkimbo in https://github.com/graphql-python/graphene/pull/1154
    • Use default_resolver to resolve values when using the source attribute by @jkimbo in https://github.com/graphql-python/graphene/pull/1155
    • Add note about the use of args by @jkimbo in https://github.com/graphql-python/graphene/pull/1170
    • Docs: integrations: fix FastAPI link by @sduthil in https://github.com/graphql-python/graphene/pull/1177
    • Fix resolve method parameters bullet list by @rrueth in https://github.com/graphql-python/graphene/pull/1178
    • Allow fast ObjectType creation based on dataclasses by @syrusakbary in https://github.com/graphql-python/graphene/pull/1157
    • added graphene import to READMEs by @kimbo in https://github.com/graphql-python/graphene/pull/1183
    • Update excluded packages list to properly exclude examples package by @radekwlsk in https://github.com/graphql-python/graphene/pull/1187
    • Fix typos by @kevinharvey in https://github.com/graphql-python/graphene/pull/1192
    • Fix issue with trailing whitespace by @jkimbo in https://github.com/graphql-python/graphene/pull/1197
    • Fix typo in quickstart document by @dbgb in https://github.com/graphql-python/graphene/pull/1201
    • Fix DateTime Scalar parse_literal methods (#1199) by @Cito in https://github.com/graphql-python/graphene/pull/1200
    • Remove @staticmethod decorator in mutations doc by @jkimbo in https://github.com/graphql-python/graphene/pull/1206
    • Remove to_const function by @jkimbo in https://github.com/graphql-python/graphene/pull/1212
    • Update requirement for Query type in mutation docs by @jkimbo in https://github.com/graphql-python/graphene/pull/1213
    • Rename variables called type to type_ by @DoctorJohn in https://github.com/graphql-python/graphene/pull/1216
    • Set min version of graphql-core to v3.1.1 by @jkimbo in https://github.com/graphql-python/graphene/pull/1215
    • Revert 1213 update mutation docs by @jkimbo in https://github.com/graphql-python/graphene/pull/1214
    • ObjectType meta arguments by @jkimbo in https://github.com/graphql-python/graphene/pull/1219
    • Add Base64 scalar by @EpicEric in https://github.com/graphql-python/graphene/pull/1221
    • Expose Base64 type and add custom scalar examples by @jkimbo in https://github.com/graphql-python/graphene/pull/1223
    • Improve enum compatibility by @jkimbo in https://github.com/graphql-python/graphene/pull/1153
    • Minor grammatical fix in the schema docs by @rednafi in https://github.com/graphql-python/graphene/pull/1237
    • Subscription revamp by @syrusakbary in https://github.com/graphql-python/graphene/pull/1235
    • Split out the subscriptions documentation a separate file and fix it by @jkimbo in https://github.com/graphql-python/graphene/pull/1245
    • Fix subscribe with arguments by @jkimbo in https://github.com/graphql-python/graphene/pull/1251
    • Fix Typo in Docs by @plopd in https://github.com/graphql-python/graphene/pull/1252
    • Fix typo in Schema docs by @varundey in https://github.com/graphql-python/graphene/pull/1259
    • add BigInt type by @pizzapanther in https://github.com/graphql-python/graphene/pull/1261
    • Syntax Error Fixed for Dictionary assert by @lnxpy in https://github.com/graphql-python/graphene/pull/1267
    • Add UnforgivingExecutionContext by @AlecRosenbaum in https://github.com/graphql-python/graphene/pull/1255
    • Remove Object Mutation dead link from Relay docs by @varundey in https://github.com/graphql-python/graphene/pull/1272
    • fix(Decimal): parse integers as decimal. by @zbyte64 in https://github.com/graphql-python/graphene/pull/1295
    • Fix links to Relay docs by @bartenra in https://github.com/graphql-python/graphene/pull/1318
    • Language fixes on index.rst by @shukryzablah in https://github.com/graphql-python/graphene/pull/1313
    • Use argument's default_value regardless if the input field is required by @minhtule in https://github.com/graphql-python/graphene/pull/1326
    • fix field name in execute.rst example by @kevinr-electric in https://github.com/graphql-python/graphene/pull/1327
    • Fix typo in docstring of ObjectType by @sir-sigurd in https://github.com/graphql-python/graphene/pull/1343
    • Allow later aniso8601 releases by @fabaff in https://github.com/graphql-python/graphene/pull/1331
    • Update pytz to 2021.1 by @fabaff in https://github.com/graphql-python/graphene/pull/1330
    • add support for query validation by @aryaniyaps in https://github.com/graphql-python/graphene/pull/1357
    • Fix actions by @aryaniyaps in https://github.com/graphql-python/graphene/pull/1359
    • Fix GraphQL-core dependency by @ekampf in https://github.com/graphql-python/graphene/pull/1377
    • Fix unseen examples by @aryaniyaps in https://github.com/graphql-python/graphene/pull/1376

    New Contributors

    • @minho42 made their first contribution in https://github.com/graphql-python/graphene/pull/1066
    • @tdiam made their first contribution in https://github.com/graphql-python/graphene/pull/1036
    • @TheMelter made their first contribution in https://github.com/graphql-python/graphene/pull/1115
    • @ymoch made their first contribution in https://github.com/graphql-python/graphene/pull/1072
    • @ibhlool7 made their first contribution in https://github.com/graphql-python/graphene/pull/1090
    • @tompao made their first contribution in https://github.com/graphql-python/graphene/pull/1088
    • @henrythor made their first contribution in https://github.com/graphql-python/graphene/pull/1080
    • @ganwell made their first contribution in https://github.com/graphql-python/graphene/pull/1111
    • @allen-munsch made their first contribution in https://github.com/graphql-python/graphene/pull/1074
    • @dsanders11 made their first contribution in https://github.com/graphql-python/graphene/pull/1134
    • @JMmmmuu made their first contribution in https://github.com/graphql-python/graphene/pull/1135
    • @ko-lem made their first contribution in https://github.com/graphql-python/graphene/pull/1139
    • @jaydenwindle made their first contribution in https://github.com/graphql-python/graphene/pull/1143
    • @rob-blackbourn made their first contribution in https://github.com/graphql-python/graphene/pull/1107
    • @hzlmn made their first contribution in https://github.com/graphql-python/graphene/pull/1159
    • @sduthil made their first contribution in https://github.com/graphql-python/graphene/pull/1177
    • @rrueth made their first contribution in https://github.com/graphql-python/graphene/pull/1178
    • @kimbo made their first contribution in https://github.com/graphql-python/graphene/pull/1183
    • @radekwlsk made their first contribution in https://github.com/graphql-python/graphene/pull/1187
    • @kevinharvey made their first contribution in https://github.com/graphql-python/graphene/pull/1192
    • @dbgb made their first contribution in https://github.com/graphql-python/graphene/pull/1201
    • @Cito made their first contribution in https://github.com/graphql-python/graphene/pull/1200
    • @DoctorJohn made their first contribution in https://github.com/graphql-python/graphene/pull/1216
    • @EpicEric made their first contribution in https://github.com/graphql-python/graphene/pull/1221
    • @rednafi made their first contribution in https://github.com/graphql-python/graphene/pull/1237
    • @plopd made their first contribution in https://github.com/graphql-python/graphene/pull/1252
    • @lnxpy made their first contribution in https://github.com/graphql-python/graphene/pull/1267
    • @AlecRosenbaum made their first contribution in https://github.com/graphql-python/graphene/pull/1255
    • @zbyte64 made their first contribution in https://github.com/graphql-python/graphene/pull/1295
    • @bartenra made their first contribution in https://github.com/graphql-python/graphene/pull/1318
    • @shukryzablah made their first contribution in https://github.com/graphql-python/graphene/pull/1313
    • @kevinr-electric made their first contribution in https://github.com/graphql-python/graphene/pull/1327
    • @sir-sigurd made their first contribution in https://github.com/graphql-python/graphene/pull/1343
    • @fabaff made their first contribution in https://github.com/graphql-python/graphene/pull/1331
    • @aryaniyaps made their first contribution in https://github.com/graphql-python/graphene/pull/1357

    Full Changelog: https://github.com/graphql-python/graphene/compare/v2.1.8...v3.0.0

    Source code(tar.gz)
    Source code(zip)
  • v3.0.0b8(Sep 30, 2021)

    Changes

    • fix: graphql-core dependency resolution. (#1377)

    All changes: https://github.com/graphql-python/graphene-django/compare/v3.0.0b7...v3.0.0b8

    Source code(tar.gz)
    Source code(zip)
  • v2.1.9(Jul 16, 2021)

  • v3.0.0b7(Jan 6, 2021)

    Changes

    • fix(Decimal): parse integers as decimal. (#1295)

    All changes: https://github.com/graphql-python/graphene-django/compare/v3.0.0b6...v3.0.0b7

    Source code(tar.gz)
    Source code(zip)
  • v3.0.0b6(Oct 21, 2020)

    Changes

    • Fix subscribe with arguments (#1251)
    • Add BigInt type (#1261)
    • Add UnforgivingExecutionContext (#1255)

    All changes: https://github.com/graphql-python/graphene-django/compare/v3.0.0b5...v3.0.0b6

    Source code(tar.gz)
    Source code(zip)
  • v3.0.0b5(Aug 6, 2020)

  • v3.0.0b4(Jul 14, 2020)

    Changes

    • Improve enum compatibility (#1153)
    • Rename variables called type to type_ (#1216)
    • Fix ObjectType meta arguments (#1219)
    • Add Base64 scalar (#1221)
    • Pin graphql-core to >v3.1.2

    Full changelog: https://github.com/graphql-python/graphene-django/compare/v3.0.0b3...v3.0.0b4

    Source code(tar.gz)
    Source code(zip)
  • v3.0.0b3(Jun 25, 2020)

    Changes

    • Fix DateTime Scalar parse_literal methods (#1199) (#1200)
    • Remove to_const function (#1212)

    Full changelog: https://github.com/graphql-python/graphene-django/compare/v3.0.0b2...v3.0.0b3

    Source code(tar.gz)
    Source code(zip)
  • v3.0.0b2(May 9, 2020)

    Third beta release for Graphene v3.

    Changes: https://github.com/graphql-python/graphene/compare/v3.0.0b1...v3.0.0b2

    Highlights:

    • Allow fast ObjectType creation based on dataclasses (#1157) Contributes to an estimated 3x speedup with initialising ObjectTypes!
    Source code(tar.gz)
    Source code(zip)
  • v3.0.0b1(Apr 6, 2020)

    Second beta release for Graphene v3.

    Changes: https://github.com/graphql-python/graphene/compare/v3.0.0b0...v3.0.0b1

    Highlights:

    • Added subscription support! https://github.com/graphql-python/graphene/pull/1107 Thanks to @rob-blackbourn for this fantasic contribution
    • Remove subclass polyfill #1156
    • The source attribute now uses the default resolver function #1155
    Source code(tar.gz)
    Source code(zip)
  • v3.0.0b0(Mar 4, 2020)

  • v3.0.0a1(Mar 4, 2020)

  • v3.0.0a0(Aug 17, 2019)

  • v2.1.8(Aug 17, 2019)

    Changelog

    • Bump pinned aniso8601 version
    • Allow mutations to apply the interfaces META argument to have the payload object type implement the desired interfaces
    Source code(tar.gz)
    Source code(zip)
  • v2.1.7(Jul 15, 2019)

  • v2.1.6(Jun 14, 2019)

    Changelog

    • Fix malformed version on aniso8601 requirement (#995) 431e93c

    Documentation

    • Revise documentation (#969) 5cb7d91
    • Expose livehtml autobuild in Makefile + Add API autodoc (#971) da1359e

    Full changelog: https://github.com/graphql-python/graphene/compare/v2.1.5...v2.1.6

    Source code(tar.gz)
    Source code(zip)
  • v2.1.5(Jun 5, 2019)

    Changelog

    • Add Decimal type d728b84e48cb107a66f0fa5d22b19b89ba2abd1c
    • Allow Union types to have descriptions 8d4b9cdc77c1a978a9ae6808ecaf5d3ed8841cd2
    • Add type documentation for Relay fields 131cbebc88229db1bbc86f432d0c5700a9f0f84b
    • Mutation description now defaults to docstring 37a6c01839687505da496d94dfd6c9f4383ca74c
    • Fix Windows support ae7a5d71c773fb3b8710a67bed8c800f2af068c2
    • The default resolver for ObjectTypes now handles dicts and objects ca9188a6150485132c27b3dddf149641935dfab2
    • Date, DateTime and Time types now accept datetime.datetime, datetime.date, and datetime.time resp. inputs when used as variables 7b6dae7fa3bf8d2e066e92e730c8a9740656a448
    • Make UUID type compatible with all string types in Python 2 7b6dae7fa3bf8d2e066e92e730c8a9740656a448
    • Allow relay connection node to be wrapped in a NonNull type abff3d75a39bc8f2d1fdb48aafa1866cf47dfff6
    • from_enum can now take a deprecation reason 6a4091b3e4734fe032397b0bcd350820f6037d0f
    • Update aniso8601 dependency to allow versions 4+ a5162e9ae39bcb7d6b0655bf3385e674611e6d17
    • Drop support for Python 3.4 because it is EOL f73055f72bf7d4b06130507eeeed4ae70f61bd97
    • Allow type annotation in meta classes eb7966eca7f9f90da1ac60c97aafa542ae3d0b38

    Documentation

    Too many documentation improvements to list out here and lots more to come. Watch this space.

    Full changelog: https://github.com/graphql-python/graphene/compare/v2.1.3...v2.1.5


    Note: v2.1.4 was never released to PyPi due to build issues. We went straight from v2.1.3 to v2.1.5

    Source code(tar.gz)
    Source code(zip)
  • v2.1.3(Jul 19, 2018)

    Changelog

    • Added crunch and deduplicator utitlities https://github.com/graphql-python/graphene/commit/fa5f5b0acbede77a27d2f6e24d651ac8d6ea8c74 https://github.com/graphql-python/graphene/commit/2e41db8d95daa3ab09c294118e20b7c38387e00a
    • Permit subclassing arguments from Mutations https://github.com/graphql-python/graphene/commit/4346832f71564b63d6025c2c9ff88d1ffd241136
    • Added precommit https://github.com/graphql-python/graphene/commit/ae7395f9da812a68f873f92cfaf8279896ce1d64
    • Moved Enum library to graphql-core, use graphql-core>=2.1 https://github.com/graphql-python/graphene/commit/d28dc68abca5597f44274e1dbd6d000ff3826084

    Documentation

    • Improved docs https://github.com/graphql-python/graphene/commit/9da46e8c998c14ec603fef2060af41530af5d45c
    • Updated interface docs https://github.com/graphql-python/graphene/commit/9efdf4c46e26aa478ced7150d0f963d77c086ac7
    • Improved Mutation Output docs https://github.com/graphql-python/graphene/commit/1b746e64609e4bc9d9baf880954415452b476812
    Source code(tar.gz)
    Source code(zip)
  • v2.1.2(Jun 14, 2018)

    Bugfix release to fix a couple of issues. Thanks to the effort of contributors for this new release @jlowin @nxtman123 @danpalmer @dan98765 @femesq 🎉

    Changelog

    • Don't overwrite fields on InputObject #752
    • Incorrectly formatted error message #751
    • Fix warning output #748

    Docs and Internal

    • Update contributing docs about using tox and sync tox pytest cmd with travis #744
    • Add isort precommit hook & run on all files #743
    • Add flake8 pre-commit hook and manually edit files to pass flake8 validation #746
    • Add pyupgrade pre-commit hook and run on all files #736
    • Update README Contributing section to encourage use of virtualenv #765
    • Fix parameter order for Relay's Root-field #754
    • Add python3.6 classifier to setup.py #763
    Source code(tar.gz)
    Source code(zip)
  • v2.1.1(May 25, 2018)

    A small bugfix release to fix a couple of issues. Thanks to the effort of contributors for this new release @nikordaris @dan98765 @femesq @devArtoria 🎉

    Changelog

    • Fix default_value on NonNull fields (9408ba70d165284ff7ab5efd159a62e1d40a9a7f)
    • Add pre-commit tool to repository, and run on all files (#730)
    • Added partial support to Dynamic type (#725)

    Docs

    • Improve v2 migrations docs (#732)
    • Add Graphene-Mongo to integrations list (#711)
    Source code(tar.gz)
    Source code(zip)
  • v2.1.0(Mar 30, 2018)

    This is a minor release, fixing a lot of small issues, with better support for Date, DateTime and Time scalars and tons of improvements on docs. Thanks to the effort of contributors for this new release @jkimbo @danpalmer @g-- @dfee @Prince-Leto @simonwoerpel @pjdelport @anisjonischkeit @abawchen 🎉

    Changelog

    • Extend support for subclassing InputObjectType meta a16c5ba00be1d963d438c5e96962b79d1b145cc3
    • Raise better error if type is missing from Schema d6968c2e92486dda40725c9ef99f450557003f2b
    • Allow ObjectType to set connection name a2178dc22098a36e56d4cec021f984f4cae3649c
    • Fixed to_camel_case utility function be1f7d72a46f29eb491d3a6110fd955d0b72dea4
    • Add py36 to tox envlist 113cf8da38dcac755599d4b26432e3eaccadc72a
    • Enable extra options in mutation fields a7a4ba62af4cb8b00ffa6a9f8cf79bd87dfb5e95
    • Improved support / assertion for GraphQL types in Schema 0971a05b33bf65cbc89038eebd85de5fec4e1dcf
    • Fixed required=True in ConnectionField 8c7ca74c6f083007a7c83c843f494357aec69371
    • Exclude examples module in package 79f7cc08e3c173e78ab33abe0d49404242f8d26d
    • Made Date, DateTime and Time scalars to fail with GraphQLError is format is invalid 84fbf5dc23351c26a852271aa6529a60bce13735 9973fd314f6134a96a78617fee1caf21d592b6af
    • Fixed Meta included in Enum members 2594cdb61409f8ecedf0958ee959f8f8ded3efbc
    • Fixed deprecations url in deprecation message a96ed550bd0c67b7a9ec0b9f636f71c530441e5f
    • Fixed str on abstract types, improved repr 562cafc14f66bbad7f76e7600fa0acd71d00194e
    • Use aniso8601 instead of iso8601 b4255e55fd28ca5b31f86876fe3f95f38f0f0838
    • Expose Date, DateTime and Time from main package

    Docs

    • Updated docs layout d6df14923dd47df69f7bec7909cb70809f31eea0
    • Relay documentation reflect latest 2.0 API ec32c252e7fdb7354e42ac931a7a7ee412d4d56c
    • Use pythonic terminology in middleware 834d52f9d3ca49e2a39fdf89da945f296b160c60
    • Added Date scalar to documentation 98366c6add10fa1532301145e9768bffcbb09dc5
    • Document functional middleware 92f6a496c5b0bb08ea976e5a675cc3310b85e585
    • Improved Scalar documentation 5036d164b74038ad4ef82add05beb73def11c317
    • Fixed typos in relay Node examples 7afeaa052bf90f9fabb5ded21f63cc724f1d1180
    • Fixed Relay links 8123c4ad8f945ec2154ce6368e3ec78e4c76700a
    • Updated middleware example to support introspection 035ff7ef885e9e158093359e93e5723298ab177e
    • Fix broken Github link tags 4fa0df401af289c43ff7e3ec73492455446c275e
    • Added documentation in NonNull lists e26c0a3717c4ff3f90ed8bd710436f8cb6ff4713
    • Fixed relay Node example d3b708533d05ef13a6b15e7a3f29eac23f812a09
    Source code(tar.gz)
    Source code(zip)
  • v2.0.1(Nov 15, 2017)

    Changelog

    • Prevent breaking changes for future releases 71177fe9776d8cf958ac3054885f891f49c1ef4d
    • Support for Enum description lambda f79eb57c063f1e2d1594fc19d1c1863feb5fc862
    • Added Date type in datetime 045d5fffbec0d32550b19421fa01a088f5cd0d8c
    • Improved ObjectType Container initialization 3ee94131ae511d2d83116730dcc4a50258ced5af (Fix for #585)
    • Non provided fields in InputObjectType value should be None (rather than the Field) b5abccb1dc733522df19d56e0906890531a700d3
    • Improved tests for nested InputObjectType f6697188ee9cbbe22df5e6971ef9686b589f4daf

    Docs

    • Fix minor gramatical error ef507c7932db6f4c90c34589f8d8af2167975f7b
    • Fix example of file upload 98c2af3fcc563fbdad75f15a04e69c38b9e61045
    • Fixed args example in docs middleware 1555c988e05049e49f119d7684fc0172e469c283
    • Fix Union docs 3412dba31fdd5e57dd545eebeb6a116f40f1cf37
    Source code(tar.gz)
    Source code(zip)
  • v2.0.0(Oct 25, 2017)

    v2.0.0 🎉

    Please read the upgrade guide to learn how to upgrade: https://github.com/graphql-python/graphene/blob/master/UPGRADE-v2.0.md

    • Simpler Graphene types implementation (thanks to __init_subclass__, and a polyfill implementation for Python 2).
    • Simplified resolver API
    • Type Options from class arguments (only available in Python 3)

    And... Subscriptions!!

    Source code(tar.gz)
    Source code(zip)
  • v1.4.1(Jun 28, 2017)

    Changelog

    • Added type consistency for Arguments #467
    • Include LICENSE in manifest for source bundles d7dff53f46967601a9b289a075a8bf7190431282
    • Improved test framework to support thenables returned when executing queries 645bfddfe955e5a51b13a7d2e58714cdbb7166ab
    • Improved ClientIDMutation tests 6c2b940a03ee708bb8788836bb7a298d5aed9c57
    • Fixed Argument output name 985252920ce2e2701388e2e20f3cc74419ff3b85 (important, please check #490)

    Docs

    • Update Relay doc link 5052536787503290fee145ada575ec8810fdf308
    • Fixed typo in docs execution bad6f5a18873c5ef6488910b8f58728b8ff1ac1e
    • Improved Upgrade guide to 1.0 b5d15b635eabcf6004e222e77c6eb9ad0963cb32
    • Fixed typo in DataLoader docs 0a9dbb608a0ee71dd556c0bd206a0b39bd5a337d
    Source code(tar.gz)
    Source code(zip)
  • v1.4.0(Apr 20, 2017)

    Changelog

    • Improved Enums comparison and getters afed25a18015643749439288a9536235232dd493
    • First version of Graphene test Client (graphene.test.Client) dfcd7f256340301d7551e2af383e4e84454db097
    • Added possible_types option in ObjectType.Meta that mimics is_type_of -> isinstance(root, possible_types) a7511d3a2c2eb59ad8342d3db85f18ea477ae379
    • Allow node inner types to be lazy e92b03bed5e1a12c558d5b1c8a03b92eecff3218
    • Updated promise package requirement to 2.0
    • Updated graphql-core package requirement to 1.1

    Docs

    • Added dataloader (N+1) docs
    • Update basic schema with arguments in tutorial doc 06757f10c6cbfb3885531b02a2c93e94491380a5
    • Added testing docs (with snapshot testing) 60e29028a8c7e025d5bbfe1d9f730c937829c98c 038f81e8e1931e1f5fb55cad80773bf6c2d2d09c
    Source code(tar.gz)
    Source code(zip)
  • v1.3.0(Apr 7, 2017)

    Changelog

    • Fix docstring whitespace 62e58bd95325604186563f54c898736db9d39585
    • Added optional default_resolver in ObjectType 98825fa4bc0f2fd6f88d11796b1093e0d63a51ee
    • Fix ObjectType inheritance with custom Meta ad251e9a8dd46d212e39da67945df4fc3e02b361 48efec307ce245bfe692f75b5dc07c14d8bce15b
    • Fixed circular Union/Interfaces d4d8a76a0936b8b8b90e6b316003c31c21e30500
    • Improved lazy_import to accept also dotted attributes d594a0eca86102ce2ebf9633018437eef8997f42
    • Use Promise.resolve instead of promisify (so we adapt to Promise 2.0) bd0d418986cf69b51801f8e4d361c0c9a5dbc17c
    • Improved lazy types support in Field, InputField, List and NonNull accepting also now string attributes (will be treated as imports, like: Field("graphene.String") 4b714659225a93ea44e95ccdd9ad1b5ea9e36c05

    Docs

    • Added Sphinx to requirements in docs e405a20e3dad7862ae315077150f23b63293a8ea
    • Fix indent in mutation docs 3a198d052acc01a8469dc03d0c0d798612830be2
    • Spelling/Grammar fix in docs 313a0041414c729fba8c2270359628b1251ce960
    • Fixed typo in link to graphql.org d86bbd8a8647bbcf9d668968977cc35c64f67f12
    Source code(tar.gz)
    Source code(zip)
MGE-GraphQL is a Python library for building GraphQL mutations fast and easily

MGE-GraphQL Introduction MGE-GraphQL is a Python library for building GraphQL mutations fast and easily. Data Validations: A similar data validation w

MGE Software 4 Apr 23, 2022
GraphQL security auditing script with a focus on performing batch GraphQL queries and mutations

BatchQL BatchQL is a GraphQL security auditing script with a focus on performing batch GraphQL queries and mutations. This script is not complex, and

Assetnote 267 Dec 24, 2022
A Django GraphQL Starter that uses graphene and graphene_django to interface GraphQL.

Django GraphQL Starter GraphQL is a query language for APIs and a runtime for fulfilling those queries with your existing data... According to the doc

0101 Solutions 1 Jan 10, 2022
GraphQL framework for Python

Graphene ?? Join the community on Slack We are looking for contributors! Please check the ROADMAP to see how you can help ❤️ The below readme is the d

GraphQL Python 7.5k Jan 1, 2023
GraphQL framework for Python

Graphene ?? Join the community on Slack We are looking for contributors! Please check the ROADMAP to see how you can help ❤️ The below readme is the d

GraphQL Python 7.5k Jan 1, 2023
Ariadne is a Python library for implementing GraphQL servers using schema-first approach.

Ariadne Ariadne is a Python library for implementing GraphQL servers. Schema-first: Ariadne enables Python developers to use schema-first approach to

Mirumee Labs 1.9k Jan 1, 2023
GraphQL Engine built with Python 3.6+ / asyncio

Tartiflette is a GraphQL Server implementation built with Python 3.6+. Summary Motivation Status Usage Installation Installation dependencies Tartifle

tartiflette 839 Dec 31, 2022
A new GraphQL library for Python 🍓

Strawberry GraphQL Python GraphQL library based on dataclasses Installation ( Quick Start ) The quick start method provides a server and CLI to get go

Strawberry GraphQL 2.8k Jan 1, 2023
A python graphql api, which serves ECB currency rates from last 90 days.

Exchange Rate Api using GraphQL Get Code git pull https://github.com/alaturqua/exchangerate-graphql.git Create .env file with following content and s

Isa 1 Nov 4, 2021
This is a simple Python that will parse instanceStats GraphQL Query into a CSV

GraphQL Python Labs - by Gabs the CSE Table of Contents About The Project Getting Started Prerequisites Installation and Usage Roadmap Contributing Li

Gabriel (Gabs) Cerioni 1 Oct 27, 2021
Pygitstats - a package that allows you to use the GitHub GraphQL API with ease in your Python programs

Pygitstats - a package that allows you to use the GitHub GraphQL API with ease in your Python programs

Dillon Barnes 4 Mar 29, 2022
Graphql-codegen library - a pure python implementation

turms DEVELOPMENT Inspiration Turms is a pure python implementation of the awesome graphql-codegen library, following a simliar extensible design. It

Johannes Roos 22 Dec 23, 2022
tartiflette-aiohttp is a wrapper of aiohttp which includes the Tartiflette GraphQL Engine, do not hesitate to take a look of the Tartiflette project.

tartiflette-aiohttp is a wrapper of aiohttp which includes the Tartiflette GraphQL Engine. You can take a look at the Tartiflette API documentation. U

tartiflette 60 Nov 8, 2022
ASGI support for the Tartiflette GraphQL engine

tartiflette-asgi is a wrapper that provides ASGI support for the Tartiflette Python GraphQL engine. It is ideal for serving a GraphQL API over HTTP, o

tartiflette 99 Dec 27, 2022
GraphQL is a query language and execution engine tied to any backend service.

GraphQL The GraphQL specification is edited in the markdown files found in /spec the latest release of which is published at https://graphql.github.io

GraphQL 14k Jan 1, 2023
Integrate GraphQL into your Django project.

Graphene-Django A Django integration for Graphene. ?? Join the community on Slack Documentation Visit the documentation to get started! Quickstart For

GraphQL Python 4k Dec 31, 2022
Adds GraphQL support to your Flask application.

Flask-GraphQL Adds GraphQL support to your Flask application. Usage Just use the GraphQLView view from flask_graphql from flask import Flask from flas

GraphQL Python 1.3k Dec 31, 2022
A library to help construct a graphql-py server supporting react-relay

Relay Library for GraphQL Python GraphQL-relay-py is the Relay library for GraphQL-core. It allows the easy creation of Relay-compliant servers using

GraphQL Python 143 Nov 15, 2022
Django registration and authentication with GraphQL.

Django GraphQL Auth Django registration and authentication with GraphQL. Demo About Abstract all the basic logic of handling user accounts out of your

pedrobern 301 Dec 9, 2022