Giter VIP home page Giter VIP logo

ariadne-website's People

Contributors

avitalb avatar biclon avatar bogdal avatar cancan101 avatar cysabi avatar damianczajkowski avatar drice avatar ecerulm avatar ejez avatar fhightower avatar flaviomicheletti avatar jenspfeifle avatar lmaxence avatar lukapeschke avatar maciejwisniowski avatar mat-sop avatar mateuszkula avatar msladecek avatar nathanielcompton avatar nilansaha avatar nullswan avatar patrys avatar petraszd avatar pigletto avatar pokir avatar pylipp avatar rafalp avatar ryanfrantz avatar sir-sigurd avatar sometimescool22 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ariadne-website's Issues

Outdated schema stitching section in apollo federation

The docs for apollo-federation is outdated.

You may have heard about schema stitching when searching for GraphQL solutions for merging multiple GraphQL servers into a single one. This approach was originally proposed back in 2018 and implemented by the Apollo Server, but it had considerable downsides which resulted in it being scrapped and federations being proposed as the new, better solution.

Schema stitching has not been scrapped and is supported by the guild. They released GraphqQL Tools v7 last year.

GraphQL Tools v7, stitching is fairly comparable to Apollo Federation with automated query planning, merged types, and declarative schema directives. -> graphql-tools

Update Docs About Returning None From Resolvers

I found this line in the docs really confusing and I'm pretty sure they are wrong based on my brief dive into the code.
https://github.com/mirumee/ariadne-website/blame/master/docs/error-messaging.md#L46

When you return none from a query resolover, you don't get any message like ""Requested item doesn't exist or you don't have permission to see it" instead you get the message "Cannot return null for non-nullable field" which can be found here: https://github.com/graphql-python/graphql-core/blob/2c2cae7cd90ffaa7286b3a48909d9b453eebec04/src/graphql/execution/execute.py#L703

For now I'm raising an error with the message I want, but this sent me down a rabbit hole trying to figure out why I wasn't getting a better message. Am I wrong about this? Am I missing something? I would love for it to be this easy to handle missing/unauthorized access.

Document integration with Django Channels

It's probably going to be the most sought-after integration until Django gets a proper ASGI interface.

from ariadne.asgi import GraphQL
from channels.http import AsgiHandler
from channels.routing import URLRouter
from django.urls import path

schema = ...

application = URLRouter([
    path("graphql/", GraphQL(schema, debug=True)),
    path("", AsgiHandler),
])

Add example for autoreload in the Django Integration docs

By default, when you change the graphql files, *.graphql, the django server isn't reloaded. To register the change to a schema file, you will have to trigger a reload using another file (mostly this can be done by opening any watched file by django and then saving it). However this gets quickly exhausting when you are making a lot of active changes to your schema definition.

I have found a way to fix this very easily and want to add relevant documentation for the same.

Regards
Diptesh

Create testing examples

Hi, before I will start I need to say thank you for the very nice and easy-to-learn package.
I am coming from the Node ecosystem, but the team decided to use Python, so we choose Ariadne to run our project :)
And I need to say was very easy to start with ( even for Python newbie )

What do you think if we can add some nice testing examples to the docs, so the new Ariadne users will able to start to write production and testable code much faster?

Confusing mutations docs typo

In the last quoted text under this section, the docs state:

Recall that resolvers need to be bound to their respective resolvers via the make_executable_schema call. If you're following along from the introduction that call will look similar to the following:

Is it supposed to be Recall that resolvers need to be bound to their respective schemas?

Modularization: "graphql" directory conflicts with graphql-core-next

Hey! In docs/modularization.md, you use the following layout:

graphql/
    types/
        __init__.py
        book.py
        query.py
        user.py
    __init__.py
    scalars.py
    schema.py

If I use that, I get the following exception:

File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/usr/local/lib/python3.8/site-packages/ariadne/__init__.py", line 1, in <module>
  from .enums import EnumType
File "/usr/local/lib/python3.8/site-packages/ariadne/enums.py", line 5, in <module>
  from graphql.type import GraphQLEnumType, GraphQLNamedType, GraphQLSchema
ModuleNotFoundError: No module named 'graphql.type'

Renaming graphql in my project root to e.g. my_graphql fixes it. Maybe it should be changed in the documentation, as graphql-core-next uses the name graphql.

Move docs to Docusarus v2

We should move existing docs to Docusaurus v2, and setup new site to have separate docs for:

  • GraphQL with Ariadne
  • Ariadne Server
  • Ariadne GraphQL Modules
  • Ariadne GraphQL Proxy
  • Ariadne Codegen

New design for Ariadne's website is in the making, but was delayed by other priorities at Mirumee, so in the meantime we could use current design.

Documentation rewrite

Ariadne documentation should have two sections:

  • The guide, that shows you step by step how to build GraphQL application using Ariadne, introducing both GraphQL concepts and translating application dev concepts like auth and testing to GraphQL.
  • The reference, that shows advanced or extra features that make no sense to keep in tutorial, like framework integrations, GraphQL explorer customization, directives, middlewares etc. ect.

error-messaging.md example doesn't work

The page https://ariadnegraphql.org/docs/error-messaging has this GraphQL schema example:

type Mutation {
    login(username: String!, password: String!) {
        error: String
        user: User
    }
}

Defining some kind of anonymous sub-object doesn't seem to be valid GraphQL schema, either with or without a : between the ) and the {.

It should be something like this:

type Mutation {
    login(username: String!, password: String!): LoginResult
}

type LoginResult {
    error: String
    user: User
}

Update custom scalar docs to mention that literal_parser is not required

This part two to mirumee/ariadne#387

Docs should be updated to reflect two things:

  1. Creating custom literal_parser is only required if logic converting GraphQL's AST to python type is needed.
  2. literal_parser will be called twice when query is executed: first to verify that AST is valid, and next time to convert AST to python type. On second call literal_parser will be called with extra argument: dict of python variables.

Callable fields require one extra argument for info object

Per documentation, this should work:

type_def = """
    type User {
        username: String!
        likes: Int!
        initials(length: Int!): String
    }
"""

class UserObj:
    username = "admin"

    def likes(self):
        return count_user_likes(self)

    def initials(self, length):
        return self.username[:length]

However, when I ran this example and tried making a query like this:

{
 user {
   likes
 }
}

I got an error:
likes() takes 1 positional argument but 2 were given

When I changed likes method to be:
def likes(self, info)
it seemed to work.

Suggested fix:
callable fields don't require an extra argument

Originally posted by @heikkiket in mirumee/ariadne#691

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.