Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Are there plans to migrate to graphql-core-next? #833

Closed
larsblumberg opened this issue Sep 10, 2018 · 10 comments
Closed

Are there plans to migrate to graphql-core-next? #833

larsblumberg opened this issue Sep 10, 2018 · 10 comments
Labels

Comments

@larsblumberg
Copy link

First of all thank you for this great library! It's a pleasure to use it.

I just came across graphql-core-next: https://github.com/graphql-python/graphql-core-next, and I'm wondering if it's going to replace the current one, https://github.com/graphql-python/graphql-core?

Are there any plans and if yes, what will be the potential benefits?

@greenled
Copy link

@larsblumberg i just found GraphQL-core-next too. You should check the roadmap.

@syrusakbary
Copy link
Member

syrusakbary commented Sep 18, 2018

Hi @larsblumberg,

The plan (in the long term) is use graphql-core-next only. However there will be a period (probably long) while both libraries can be used indistinctly.

Specific roadmap

Right now the APIs for graphql-core and graphql-core-next are very similar, but not compatible at all.
We need both to be almost 100% compatible, so Graphene can start using them indistinctly.

For this to work, we would need to:

  1. Port some functions, such as graphql_sync, from graphql-core-next to graphql-core
  2. Adapt graphql-core-next to be able to use some features that are currently only on graphql-core: middleware, custom Typemap creation (on the works)

Benefits of using graphql-core-next

Python 2 is coming to an end. There are a lot of features of Python 3 that we can't use direclty, such as:

  • Type annotations (static typing with mypy)
  • async/await syntax
  • async iterators (ideal for subscriptions)

By using graphql-core-next we will deprecate the usage of custom executors and promises, and take advantage of the Python 3 new features. While removing a lot of boilerplate code that was needed for Python 2/ 3 compatibility.

Hope this clarifies your questions!

@syrusakbary
Copy link
Member

I've been working with @Cito laying out a plan for a transition.

Here is what we decided:

  • Consistency across projects is a must, therefore we are going to port graphql-core-next to graphql-core so they have exactly the same API (with some minor tweaks). This also will bring the latest features of the GraphQL spec to Python 2. I'm already working on this and will have a prototype ready in a few days.
  • All packages (when used in Python 3) should be 100% compatible with one or the other library (thanks to the fact that promises are awaitable and observables can be iterated as async iterators)
  • Graphene should be compatible out of the box with graphql-core and graphql-core-next (ergo, we can make a conditional dependency on using graphql-core or graphql-core-next just depending on the Python version)
  • We stop fragmentation at the core

@syrusakbary
Copy link
Member

Here is an update on graphql-core, on the modernized version based on graphql-core-next:
About 1476 of 1596 tests are now passing.
I will create a branch in graphql-core named modern with all the changes once all tests are passing.

Once that's achieved, I will work on the next version of Graphene (v3) that will support it, along with new awesome features.

@patrick91
Copy link
Member

@syrusakbary is there a public roadmap for the new features?

@syrusakbary
Copy link
Member

Here it is: https://github.com/graphql-python/graphene/blob/master/ROADMAP.md#graphene-3

(It should be getting more detailed as time passes)

@syrusakbary
Copy link
Member

GraphQL-core (modern) is now passing all tests for both Python 2.7 and Python 3.4+ 🎉
That means that all the new features of the latest GraphQL spec (June 2018) and draft (Oct 2) will be available once a new release is scheduled.

https://github.com/graphql-python/graphql-core/tree/modern

There are few things left to do in order to be able to use it with Graphene:

  • Add support for executors (probably refactor the way they are architected... as just a gather option is required)
  • Add support for snake_case fields represented externally with GraphQL with camelCase naming
  • Update all dependencies (http-framework integration, websockets integration) to use a new package graphql-backend for query execution (that abstracts the API of https://github.com/graphql-python/graphql-core/tree/master/graphql/backend in a new package)
    • Add execute, execute_sync and subscribe methods to the GraphQLDocument

@eMerzh
Copy link

eMerzh commented Feb 7, 2019

@syrusakbary Thanks for your work and the update 👍

Small question, we were planing to move from -core to -core-next because we use asyncio and wanted to use updated graphql feature. But reading this it seems that you plan to incorporate the next into the modern branch then make it the "only" maintained repo.

So, should we wait until modern is ready, should we use -next, or 42?

@stale
Copy link

stale bot commented Jul 29, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Jul 29, 2019
@stale stale bot closed this as completed Aug 5, 2019
@eMerzh
Copy link

eMerzh commented Aug 5, 2019

Ftr and those following... Graphql core next will become v3 and is published as alpha at the moment. The rest will follow on the other repo ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants