bar65

bar65

How can I create blog api for my website?

screen:

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 ?

First Post! Switch mode

thelastinuit

thelastinuit

Those are queries. You need mutations to submit data, If I got what you meant.
i.e. GraphQL with Absinthe on Phoenix - Mutation

Most Liked

benwilson512

benwilson512

Author of Craft GraphQL APIs in Elixir with Absinthe

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.

thelastinuit

thelastinuit

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.

Does that make sense?

al2o3cr

al2o3cr

Storing the data is unrelated to GraphQL - the article doesn’t mention it explicitly, but there are a few calls that look like context references:

  • Accounts.get_user_by_email
  • Accounts.list_users
  • Blog.update_post

Last Post!

bar65

bar65

ı understand now tnx so much :slight_smile:, can I hold data in postgress and fetch it?

Where Next?

Trending in Questions Top

jonnycharles
I’m in search of an Elixir library that offers PDF generation capabilities similar to Ruby’s Prawn. While there have been discussions abo...
New
spammy
I’m looking to build a personal workflow to quickly deploy web applications written in elixir/phoenix, for local consumption (ie not on t...
New
silverdr
Using Phoenix.LiveView.TagEngine as an EEx.Engine is deprecated! To compile HEEx, use Phoenix.LiveView.TagEngine.compile/2 instead. Sta...
New
saveman71
Hello ! We want new/edit form pages to POST/PUT to their own URL rather than the resources REST defaults (post /things, put /things/:id)...
New
dli
Before I dive in myself, did anyone successfully sprinkle Hologram into their existing LiveView app? Looking for hints regarding: Addi...
New
bottlenecked
Hi all, I wanted to ask how the community is dealing with post-release steps. Today we have Ecto migrations, which make sure that the db...
New
michallepicki
I am using Oban and occasionally, shortly after a deployment, a handful of jobs can fail because of dependency on other parts of the syst...
New

Other Trending Topics Top

JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve. They are GUI (Emerge) and State management (S...
New
ausimian
Emily is an Elixir library that runs Nx computations on Apple’s MLX. Install it as the default Nx backend and Nx, defn, Axon, Nx.Serving,...
New
type1fool
I just stumbled on a newly redesigned elixir-lang.org. :tada: It looks like @Software_Mansion did the work, and I think it is generally a...
New
akoutmos
@hugobarauna and I (Alex Koutmos) have been hard at work on writing a book on Nerves that takes you from simply blinking LEDs to building...
New

We're in Beta

About us Mission Statement