What exactly is the simpler solution that doesn’t result in your same cons mentioned?
There are patterns that can get you the same benefits without having to use GraphQL. Even on a REST API, you can achieve the same pros > - It makes working with describing the data you want easy > - It can save you bandwidth. Get what you ask for and no more You can describe the fields you need (and I assume that is what reduces the bandwidth) GET /users?fields=name,addresses.street,addresses.zip > - It makes documen…
GraphQL kinda sucks
131–140 of 448 posts
Re: GraphQL kinda sucks
#132It's not an unpopular opinion: it's true. Graphql is a terrible piece of software/paradigm. I've completely avoided it for years. If a potential new job contacts me and they use graphql, it's an immediate no from me. It's an immediate red flag that the engineering culture at the company is poorly run and would be a nightmare to work in. Run away, as fast as possible.
Great. What is your take on the postal service structure of Turkmenistan btw?
Re: GraphQL kinda sucks
#133> It doesn't support map/tables/dictionaries. I don't understand this point. Is this talking about implementing GraphQL on the backend? Because consuming GraphQL you get a map, you get JSON! Do you mean a more specific data structures like a Set or Stack?
I think they were complaining that you couldn’t get back a query with unknown keys like a “select * from my_table” GQL equivalent
Random-access structures like dictionaries, hashmaps make no sense in this context: It would be stupid if you had to do extra work to tell graphql what your preferred key parameter(s) are so that it can create a dictionary, and then you get list-like performance anyway.
Re: GraphQL kinda sucks
#134Re: GraphQL kinda sucks
#135Earlier quoted context omitted.
You can do something like this. This query can be created and run on the client: ``` const SAMPLE_JOIN_QUERY = gql` query ($main_data_id: String!) { mainData( main_data_id: $main_data_id) { id main_data_field_1 main_data_field_2 main_data_field_3 related_data{ related_data_field_1 related_data_field_2 related_data_field_3 } } } `; ```
in other words, it's up to the folks writing the resolvers to manifest and implement that join as a nested field.
Re: GraphQL kinda sucks
#136Earlier quoted context omitted.
Let's say you need to get a field back that is already in the database table, but that wasn't previously returned by the GraphQL endpoint. All you have to do on the front end is ask for it and GraphQL will populate it for you on the server.
A world where the front end can access any database field it wants sounds like a security / privacy nightmare to me. Of course there are ways to prevent data from being returned but that’s fragile.
Re: GraphQL kinda sucks
#137Re: GraphQL kinda sucks
#138Default hostility to new concepts and frameworks can save a lot of time, energy and mistakes in software but sometimes for some use cases the new (variation of an old) solution can be superior.
We use it as the API we expose for our React and mobile clients and it's just, so good. I'd never want to consume it for a non-FE client but it's night and day versus stitching the results of multiple API calls together using some godawful chunk of mess like Redux.
We have a C# backend and Typescript frontend. We write our backend resolvers of the form `public async Task GetSomeNamedField(TypedParams pq)` and it just works, Apollo generates type safe client code and we define the schema in a single place. We still write backend code to implement each resolver method, exactly how we did in a normal API but... that's just the same.
I wonder how bad other backend devx must be for all these people to hate it, it seems more like a language specific implementation flaw than a genuine problem.
Re: GraphQL kinda sucks
#139It's not an unpopular opinion: it's true. Graphql is a terrible piece of software/paradigm. I've completely avoided it for years. If a potential new job contacts me and they use graphql, it's an immediate no from me. It's an immediate red flag that the engineering culture at the company is poorly run and would be a nightmare to work in. Run away, as fast as possible.
Yup, gotta trust the words from some unknown from internet, with 0 proof. As if we're all there, up in your head, able to hear every single thought you have and determine that what you say is pure, unfiltered truth. If many manage to use GraphQL and be content with it, that should be an indicator to you. But, you chose it isn't and that you'll merely display how politely negative you can be. Thank you.
> pure, unfiltered truth
noone is forcing anyone to believe in anything, it's just some guy expressing his strong opinions about a subject, but no, you act like someone uttered a blasphemy against the lord's name
Re: GraphQL kinda sucks
#140Having had experience with it from a "backend for the frontend" perspective, GraphQL is nice because it gives you an API for free and does partly decouple the frontend team. At the same time, with most backend GraphQL frameworks the decoupling will be very illusory, as in practice you'll have to tune the backend to the frontend use cases or you'll just end up with a ton of N+1 queries and terrible performance. In oth…
[1]: https://sixfold.medium.com/reducing-database-queries-to-a-mi...