bagasprstyadi
I’m looking for a module or something that can be used for validating a graphql query/mutation on Elixir. I’ve researched for it and stumble across a cool middleware called yup-middleware: GitHub - JCMais/graphql-yup-middleware: Add validation to your mutations arguments using yup! · GitHub but it is not for elixir
Is there a same module to in elixir that can be used to validate? I know I can use Absinthe.Middleware but I was just wondering if there is such a module that is easier to use.
Trending in Questions
One of my LiveView view’s has a very heavy javascript dependency so I want to avoid loading it for every page on the site, while still us...
New
Hi all!
I know that quite a few people use Phoenix LiveView but it is hard to get a more up-to-date list of folks/companies using it. I ...
New
Hello everyone!
I am new to coding with Elixir/Erlang. And i am looking for some utilities for fuzzing testing like AFL++.
Does anyone ...
New
I’m very new to Elixir, so sorry if this is a silly question:
I am wondering what happens to the mailbox of a process when the machine i...
New
I load tested a plain Phoenix chat app backed by Postgres with 100 million messages in it, everything on default settings, to see what br...
New
Hey, I know this has been discussed ad nauseum, but I couldn’t find a definitive answer or at least some consensus around this, so let me...
New
I don’t suppose you can lazy load a library depending on runtime data? For example if it’s a certain user they can lazy load ‘library A’ ...
New
Other Trending Topics
Edit: 2026 May 15 - This post is archived.
Mob is alive!!
Main docs: mob v0.7.11 — Documentation
A bit of explanation for the slightly c...
New
I fully migrated to my own harness from Anthropic/Gemini and I think it’s time to share it. Welcome DSH, the DeepSeek Harness, fully writ...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Hi everyone :waving_hand:
I’ve been working on PhiaUI, an open-source UI component library for Phoenix LiveView, and I wanted to share i...
New
On November 23, 2026, an unauthorized third party exploited a vulnerability in hex.pm (CVE-2026-129514, CVSS 10.0) that let them run comm...
New
@hugobarauna, Dr. Dimitrios Koutmos (my brother) and I (Alex Koutmos) have been hard at work on writing a book on how you can use Elixir ...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #code-sync
- #exunit
- #discussion
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #ai
- #authentication
- #elixirconf-us
- #umbrella
- #full-time-contract
- #blog-post
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-eu
- #distillery
- #security
- #processes
- #api
- #forms
- #hex










Showing Posts 1 to 9- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
abitdodgy
Can’t you use Ecto changesets? A quick search yielded Kronky. But I’m not sure if this is what you are looking for.
Virviil
GraphQL seems to be a strong typed query language, so absinthe will validate all the parameters for you.
So, when you say “validate” what does that mean? Validate upon business logic? This probably should be done in Ecto Changesets or resolvers.
sorentwo
GraphQL types can be leveraged for data validation to a large degree, provided you make use of the tools it provides (i.e. enums). You can get additional validation through custom types like
emailorurl, but you’ll need to write the parsing and dumping yourself, and in a way that emits helpful errors.There are plenty of places where GraphQL/Absinthe can’t help you though. For example, if you want to enforce a string is a certain size, or that a particular field is filled in but another isn’t, or a provided ID actually exists in the database. You’ll need to fall back to validating with Ecto and your application’s business rules.
bagasprstyadi
If using changeset what I concern is that, there will be a lot of business logic before entering the schema right? What if I want to validate like a lot of formating for example name, email, url. I think Kronky is some module that helps you to return error message back to graphql
bagasprstyadi
Yes Graphql already provided with basic validate parameters as in :string, or :integer. But what I need is something a bit more like String is must be length of with format x. Like that
joaquinalcerro
Bagasprstyadi,
Check-out this talk where the presenter uses Ecto Changeset to create a validation layer.
https://youtu.be/k_xDi7zAcNM
Hope this helps.
Best regards,
Joaquin Alcerro
Virviil
It may be not so obvious, but you don’t need string to be with minimum length. You need password to be minimum length.
And this leads us two 2 different solutons:
You can create GraphQL type Password, it’s easily achieved with Absinthe library itself.
You can pass password as string, but validate it on your business logic. This can be done with your Ecto structures.
bagasprstyadi
Wow thank you, I will check it!
bagasprstyadi
“You can create GraphQL type Password”
This is interesting, so I can create custom type right, and then the graphql will validate it? Awesome, Im gonna look into that