irrigator
Recently I’m learning GraphQL by reading Craft GraphQL APIs in Elixir with Absinthe. So far everything makes sense, but the overlapping of three data layers - GraphQL, Ecto and Database schemas - concerns me in some way. Surely they operate at relatively different levels, and keeping them separate adds a lot of flexibility to your system. But the cost is also pretty high. Not only are there much duplication among these three layers (type definitions and some business logic), you also need to think about putting which portion to which layer, if not implement it more than once. The most prominent example is validation.
The situation reminds of the Phoenix context, which also asks for a deep thinking about design. For those who are using GraphQL with Ecto, what’s your take on this?
Trending in Discussions
Other Trending Topics
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
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixirconf-us
- #ai
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming











Showing Posts 1 to 7- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
Qqwy
This is a really good question, and I am also very interested in an answer. Exactly this issue (a seeming duplication between the GraphQL API and the database schemas) has prevented me from using GraphQL in my projects so far, because it seemed overkill most of the time, and I was a bit scared of trapping myself in a web of fake refactored duplication.
StefanHoutzager
Maybe you can find a discussion on some of the problems you found here? Five Common Problems in GraphQL Apps (And How to Fix Them)
peerreynders
Phoenix contexts acknowledge that there are designs beyond CRUD. In CRUD applications the shape of the data in the page on the front end tends to dictate the shape of the data that is stored in the database. This is the hallmark of implementation coupling. Typically when you change something on one end that change ripples through to the other end (and any layers in between).
That overlap may simply be a result of the technology being applied to an application with an “unsophisticated” domain - which wouldn’t be surprising if the entire point of the application is to clearly showcase how the technologies interact - without being obscured by complex application design concerns.
BitGonzo
Though I don’t have much to say on the subject myself, I have found this article to be an excellent read (quite comprehensive of an overview):
Will be interesting to see how things develop.
mkunikow
I am wondering is there the same problem with https://www.apollographql.com ?
So I assume will be the best have some sort of distributed database with GraphQL functionality …
or GraphQL hosted as service … something like https://firebase.google.com/
Edited
I think there will be the same problem with apollo.
https://github.com/serverless/serverless-graphql
So in this case I prefer hosted service like firebase
I see another option
https://www.npmjs.com/package/neo4j-graphql-cli
https://dzone.com/articles/graphql-meets-graph-database-a-graphql-neo4j-integ
OvermindDL1
What I think would be best for graphql projects is just have the database, have a graphql layer, and have both the API and Web Controllers access the GraphQL layer (so Controllers just call into the local GraphQL bit), that way it all goes through a single defined point that handles auth and all.
mkunikow
Yes I totally agree.
I have some hopes for Neo4j-GraphQL project or some cloud providers that would distribute it as service , maybe as competitor to google firebase.