richeterre / jumubase

A friendly monolith for managing "Jugend musiziert" contests ♫
MIT License
3 stars 0 forks source link

Add GraphQL API #13

Closed richeterre closed 5 years ago

richeterre commented 5 years ago

On this branch we can work on exposing contests and performances via GraphQL.

As a first step, we set up Absinthe and create a simple schema with example data.

richeterre commented 5 years ago

@rannick I also added some tests to ensure that only public contests are exposed, and that a contest has both id and name fields. You can find them here:

https://github.com/richeterre/jumubase-phoenix/blob/graphql/test/jumubase_web/schema/query/contests_test.exs

To run tests, you can use the command mix test. Try adding a simple field to the contest, such as isFun which is a boolean that always returns true, and expand the second test to take this into account 😄

richeterre commented 5 years ago

Alright, looks like this is ready to merge 😅 The API should now expose all data required by the mobile apps. It's self-documenting and can be explored on the local server under this URL: http://localhost:4000/dev/graphql-playground