I am new in elixir, so since one week I am try to build graphiql api with absinthe. I did not understand how I will create api like in screen, I want to create blog api for my website , but I do not know where I will create blog data, here an example tutorial, but I guess it old for new version, and it is not clear tutorial for junior like me. Any idea ?
yes I want to hold blog data, but I will do it in where? for example for any kind of applications, you will hold data like image, title, body, video in where? how I will create blog api?
Ok, I think I misunderstood your question.
So, it depends on you. You can have a db to hold your data (Ecto as your lib to manage your db). From that, you can use the so called resolvers to retrieve that data or to save the data. Resolvers are called from queries or mutations.
In the end, the resolver is the one that provides the data back. It doesn’t matter from where really, that’s why it depends on you.
So, the question is: where do you want to save or keep your data? For example, if you have your data in a file within your code, it means that you will need to make a new release every time you update your data. However, if you access that file say from Amazon S3 to deliver the data, then your elixir release will be just to update your code. The same situation happens if you use a db.
I think this is not a good idea. If you are new to Elixir, you should take some time and learn Elixir fundamentals. Then you should learn some Phoenix and Ecto fundamentals. Only then should you try to take on Absinthe. Absinthe’s learning materials and books assumes you already know what you’re doing with Elixir, Phoenix and Ecto.