menu

Ariadne GraphQL

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

Channels
Team
Posts
Members
Info

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

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

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

disabling graphql playground

is there any way yo disable graphql playground just like in apollo by setting false value and if it is possible then how we will provide body of mutation type.

thumbsup
0
message-simple
6

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

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

Subscription example

Hello everyone! To be honest, my primary reason to move from Graphene to Ariadne was subscription support. The example from the documentation works fine, but I'm looking for more robust solution that doesn't involve infinite loop with sleep and constant checking for some…

thumbsup
0
message-simple
28