menu

Ariadne GraphQL

Ariadne is a Python library for implementing GraphQL servers using schema-first approach.

Channels
Team
Posts
Members
Info
down-caret

Help to define a Type where a field is an array of objects.

I have the following collection in a MongoDB database: So, every document in the collection above represents a given farm. Every farm is a set of areas/fields and for each field I have a geo-shape definition (GeoJson). Then, I have the following GraphQL query: …

thumbsup
0
message-simple
0

example of how to use query filter and limit?

Not sure how to implement complex query filtering and limit I have the following simple example for query Movie of year 1920 { …

thumbsup
0
message-simple
2

How to prevent logging of "handled" exceptions?

I'm using thrown exceptions and a custom error formatter to report things like "unauthorized" to my clients, however all of these exceptions are being logged (with stack trace) by ariadne.asgi.GraphQL.observe_async_results -- filling up my logs (and unit test output) with noise.…

thumbsup
0
message-simple
2

Storing and Handling Multiple "connection" Objects

I have a project that requires multiple different connection objects e.g. Redis Connection Pool, HTTPX Client etc. Currently im storing these in a custom Context class thats passed to resolvers. Would this be best practice? Is there a better way to do it? Like importing a…

thumbsup
0
message-simple
2

Async Directives

Has anyone used async directives? I have a simple rate limiting FIELD_DEFINITION directive that checks redis using the aioredis lib. The SchemaDirectiveVisitor method "async def visit_field_definition" is not being awaited when I try to "await redis.get(key)".

thumbsup
0
message-simple
1

Pagination

Does anybody have any examples of supporting pagination in Ariadne? I searched for 'pagination' here but got nothing. How are folks handling large data sets in resolvers?

thumbsup
2
message-simple
4

Session handling using Ariadne - am I doing it wrong?

Hello! I'm extremely happy with using Ariadne so far (though - still experimenting, not on prod) but I ran into an issue with handling sessions for users. I tried to implement basic authentication using Starlette's Auth middlewares but it looks like the session is not created in…

thumbsup
0
message-simple
19

How to have ariadne support HTTP GET request ?

Right now, I have a plan to move from Graphene to Ariadne. Everything good so far but only one problem that when call GET request, Ariadne always return playground page. I passed query as a query string in URL but not work. Is there any solution for this ?

thumbsup
0
message-simple
10

Error handling questions

Hi, so far I just raise an exception in resolver if I the query itself is ok, but does not fit my logic (such as not found, etc). There are quite a few of such cases, I end up need to try and catch in every resolver, copy and paste almost the same exception handler. At a certain…

thumbsup
0
message-simple
9

How does the default resolver lookup work?

Hi everyone, I have written some classes that provide the resolvers for the schema defined in *.graphql files. I guess I can bind them all manually using query = ObjectType("Query") etc. but that seems quite cumbersome. Instead, it seems like I could just rely on the default…

thumbsup
0
message-simple
10