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: …
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.…
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…
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)".
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…
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 ?
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…
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…