Questions tagged [graphql]

For questions about GraphQL, an API technology designed to describe the complex, nested data dependencies of modern web applications.

GraphQL is a query language for APIs and a runtime for fulfilling those queries with your existing data. GraphQL provides a complete and understandable description of the data in your API, gives clients the power to ask for exactly what they need and nothing more, makes it easier to evolve APIs over time, and enables powerful developer tools.

There are GraphQL implementations in almost every server-side language, and powerful clients for most UI platforms.

20 questions
9
votes
2 answers

When to choose Graphql over REST

We currently have an application with various frontends, a backend with a python tornado server, MongoDB and a "REST" API (that isn't very RESTful) so are looking to update to a version 2. A new start is suggesting GraphQL over REST. I am a little…
wobbily_col
  • 1,861
  • 3
  • 16
  • 25
9
votes
4 answers

"REST Vs GraphQL" is it a correct comparison?

I saw in many sites that compare REST with GraphQL. after investigating this concern (actually my concern) that, "is it a correct comparison?", I being more confused. Since the REST has a different definition against GraphQL, this question busies my…
m3hr24d
  • 107
  • 4
7
votes
1 answer

What architecture layer is GraphQL part of?

I'm currently dealing with a GraphQL project with poor architecture. I read about where to put AuthZ checks and they refer to the "business layer" as to be called from a GraphQL resolver. Up till now, I thought GraphQL belongs in the Data Access…
Christopher Francisco
  • 2,392
  • 1
  • 12
  • 27
6
votes
2 answers

GraphQL - Should I expose link tables?

I am experimenting with converting an API to GraphQL, and I have a database that has many-to-many relationships that are stored via link tables; something like this: CREATE TABLE accounts ( id int, last_name varchar, first_name…
TylerAndFriends
  • 203
  • 1
  • 5
3
votes
0 answers

How do I architect reordering in database?

I'm building a todo list app and using react-beautiful-dnd on the frontend to allow users to reorder tasks. I'm trying to work out how to persist changes to the database when a user reorders items. With react-beautiful-dnd, when a reorder occurs,…
mrseanbaines
  • 131
  • 1
3
votes
1 answer

What *really* is the difference between relational and non-relational data?

Here is where I am at right now: I know that relational data, like that found in relational databases like MySQL or Postgres, is relational because there are relations between the tables. That is the reason why RDBMS have rigid schemas. On the other…
2
votes
3 answers

In RESTful APIs, what's the proper way to have different resource properties based on user authorization?

I'm struggling with defining proper endpoints for a RESTful API, given the following requirements: We have an existing /customers endpoint, which when called with the GET verb, returns a list of customers, which look like so: { "id": "some-id", …
Alex
  • 131
  • 3
2
votes
0 answers

Where to store the state of a complex form in React?

Let us consider a complex form of registering a driver and owner. The driver will have all these fields: driver = { firstName: "xyz", lastName: "abc", phone: "1234", email: "m@g.com, licence: "xy1234" } And owner has the following fields: owner =…
1
vote
1 answer

Difference between Resolvers and Controllers?

I may be overthinking it, but are controllers and resolvers the same thing in web applications? Coming from the MERN stack, everyone used to call these request processing functions "controllers," but in PERN+GQL, everyone calls them "resolvers." By…
twominds
  • 129
  • 6
1
vote
1 answer

Doesn't Apollo Federation for GraphQL services encourage bad software design?

Background In the scenario GraphQL Federation was designed for, you have numerous GraphQL microservices in the backend, each with their own Schema Definition Language (SDL). Theoretically, these services are able to start and run independently and…
Anchor
  • 203
  • 1
  • 5
1
vote
1 answer

What are the differences between server-server communication vs client-server communication

How does server-server communication compare to client-server communication? I'm wondering if there are any performance benefits when putting a GraphQL layer in between my client-side app and my rest-server. For arguments sake, let's say an endpoint…
1
vote
0 answers

Strategy for a worker microservice to communicate with GraphQL API

I am trying to find the best way for a microservice to communicate with GraphQL Basic scenario: Client subscribed to GraphQL via Subscriptions (WebSockets) Client creates an Item using Mutation which will notify all the subscribed clients that the…
inside
  • 111
  • 4
1
vote
0 answers

Offloading database joins to IOT devices

Solution as it is right now I have this solution where I gather information from a proprietary product of a different company in various sites. The solution is based on a single go binary that contains everything needed to run the application (even…
Marged
  • 225
  • 3
  • 11
1
vote
4 answers

Performance issues in an pseudo microservice environment

I'm currently working on a project which is build as a microservice architecture. We have one "Gateway" which aggregates the data coming from the different microservices to return one aggregated result to the frontend. The "Gateways" exposes GraphQL…
1
vote
0 answers

Are REST Resources and GraphQL Object Types conceptually equal?

I'm in the process of outlining the intended business logic of a web service. At this point, I'm not too concerned with implementation details. On the contrary, I'm looking for ways to abstract them away in order to describe the business logic and…
Willem-Aart
  • 325
  • 2
  • 11
1
2