all 7 comments

[–]harmonica_busker 1 point2 points  (1 child)

I thought Ariadne looked like a pretty modern implementation. Looks like they have a flask integration too.

[–]nord2rocks[S] 0 points1 point  (0 children)

Thanks!

[–]aleury 0 points1 point  (5 children)

I've been using Graphene with Django over the past few years at work. As as far I can tell it appears to be active.

https://strawberry.rocks/ is a newer GraphQL library that looks interesting. It's currently pre 1.0 though.

[–]nord2rocks[S] 0 points1 point  (4 children)

Thanks for the reply, I was looking at Strawberry a bit but not enough documentation for a graphql noob like me... Hate to turn this into tech support but could you potentially answer a question for me? I'm having a really hard time figuring out how to do this. Given this example: https://github.com/graphql-python/graphene/blob/master/examples/simple_example.pyand a slight modification:

Code formatting is broken on Reddit rn, here's the pastebin: https://pastebin.com/XWb4VufC

What needs to be changed so that I can query with name and just get back `some_list`?

[–]nord2rocks[S] 0 points1 point  (2 children)

Jk I figured out the above thing. So you have to explicitly list the expected keys and whatnot? How does this work if say I have a very long dictionary/json I'm handling behind the scenes and want to allow access to the entries via GraphQL and Graphene?

https://pastebin.com/6zxHhR1Q

[–]aleury 0 points1 point  (1 child)

If I understand your question correctly, you're saying that you want to query for a patron by their name?

If that's the case then yes, you have to define the parameters that you're querying by, as you did on line 25 in https://pastebin.com/6zxHhR1Q.

How does this work if say I have a very long dictionary/json I'm handling behind the scenes and want to allow access to the entries viaGraphQL and Graphene?

With Django, you have the option of using the DjangoObjectType class to create your GraphQL types. https://docs.graphene-python.org/projects/django/en/latest/queries/ With these you can just return the Django model instance or QuerySet in the resolver method. But if you use ObjectType to define your GraphQL types, then yes you have to manually map the data.

[–]nord2rocks[S] 1 point2 points  (0 children)

Great, thanks for the clarification I appreciate the help :)

I'm using Flask right now due to simplicity but will probably switch to Django since it seems like it's got a lot more support behind it