Giter VIP home page Giter VIP logo

Comments (3)

rafalp avatar rafalp commented on July 22, 2024 3

Hello!

There are plenty of differences, but main one is schema-first approach to creating GraphQL APIs.

In Ariadne you describe your schema using SDL language and you use simple and easy to memorize Python API to bind your business logic to this schema. In Graphene you define your schema using Python types only, and then schema is generated for you from those types. There's example code in our readme if you want to see this pattern in action.

There are plenty of reasons why we used new approach vs Graphene's:

  • All learning materials, examples and snippets outside of Graphene are using SDL for describing types. With Ariadne we don't need to learn how to translate those examples to Graphene types before using them.
  • Frontend dev tools are schema first, and expect your GraphQL to be available either as running server, or .graphql files somewhere in your project repo. Saleor required extra setup for those tools to work. In Ariadne this is the default.
  • SDL is actually easy to learn and fast to write. It's also a language that both backend and frontend devs speak, which is nice gain for projects like Saleor. Changes to SDL also produce nice diffs.

As for other reasons, we also wanted to have a fresh start and do some other things differently. For example, there are situations when you would like to have two GraphQL API's in project, to support two mostly separate clients (storefront and admin dashboard). This use case is (was?) not supported by Graphene when we needed it, leaving us with single API mixing user-only data with admin-only information, leading to weird bugs where something that shouldn't be, leaked to store users. In Ariadne there is no global type registry, which allows us to have as many different GraphQL API's in single codebase as we want, while keeping things explicit and easy to navigate.

There are plenty other reasons for fresh start like having thin API that's easy to dive into and extend as you need it, and opening the path for implementing some extra features that were important to us, like query batching or cost validation.

And can we use Graphene-django in Saleor?

Please ask on Saleor's forum or github repo.

I hope this helps you ;)
Cheers!

from ariadne.

jrast avatar jrast commented on July 22, 2024

@rafalp thanks for this comparison! Would it be possible to integrate this information in the docs somewhere?

from ariadne.

rafalp avatar rafalp commented on July 22, 2024

We have new site in the pipeline that will include this. Stay tuned :)

from ariadne.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.