Any other GraphQL Federation implementations apart from Apollo? - graphql

I have been trying to build a federation gateway on top of existing graphql services and am curious if there are any other implementations of the same apart from apollo federation?
I tried to find but couldn't find any. I am also looking for subscription on the federated gateway. Does anybody know any other implementations on the same?

It seems that fastify-gql now supports being a Federation Gateway, with subscription support included.

Yes:
Graphene (for python) with Graphene-Federation implements federation (there is in built support for graphql subscriptions). I have used this for a large-scale project and it works just fine (Although I personally prefer apollo)
I haven't personally used this, but tyk.io seems to have a pretty neat solution for federation: https://tyk.io/blog/an-introduction-to-graphql-federation/
Bramble - https://movio.co/blog/building-a-new-api-platform-for-movio/
Great for GoLang. I haven't used it, but I have a friend who has
Something else that is not pure "federation" per-se - but which would solve your problem easily is GraphQL Mesh. https://www.graphql-mesh.com/
Hope this helps :) !

Related

graphene: is relay needed for a complete, functional server?

Background:
I have a nodejs graphql server, and I want to learn Fastapi by reimplement the server with it.
It seems that graphene is the only option.
I learned graphql with Apollo,(and the server is built with apollo-server) and found all those "relay"-related features and conceptions confusing.
Connections, nodes, edges...
(I did some research and know the meanings of those concepts now)
From other SO questions like this, all(?) relay features can be implemented by other means.
But there is even a graphene.relay, so I doubted my conclusion.
question:
Is relay necessary to built a graphql server?
Just want to make sure it's not a dead end before spending too much time on it.
Relay specs are just a type of specification. It is not necessary to build a GraphQL server. However, if you are specifically referring to graphene-python, then I'd recommend using Relay as it already has complete support for Relay specs.

GraphQL - Are "Federations" a Vanilla Graphql thing or an Apollo thing?

I'm having a hard time differentiating from what's vanilla GraphQL and what's Apollo.
I'm trying to understand schema stitching and see that using Fragments and Federation are two different ways to do this.
Found this enlightening
https://www.apollographql.com/docs/graphql-tools/schema-stitching/
Do I have to buy-in to Apollo to use Federations?
On the graphql spec there is no mention of Federations. Federations are only a part of apollo.

GraphQL, Apollo, Relay … how do they fit together?

When trying to get started with GraphQL, you meet a lot of new terms: Some are related to the concept of GraphQL itself (mutations, subscriptions, …), but there is also an entire ecosystem around it, which – unfortunately – is not always separated clearly from GraphQL itself. However, I find it quite hard to tell where one thing ends, and where the other one starts, and what the differences are, and what is needed when.
So, to name a few of these terms:
GraphQL
Apollo
Apollo Client
Relay
Can you explain maybe in a few sentences what these things (except GraphQL) are, what they are good for, and how they relate to each other (or don't)? And, which important tools / concepts are missing here?
GraphQL The language
GraphQL is a query language. It has a specification that defines the language, schemas and also the execution of GraphQL queries. Learning these things is a great place to start and completely programming language agnostic.
GraphQL implementations
Then there are different GraphQL implementations in different languages that allow you to create a schema and describe how the query resolves to values. Usually these implementations validate the query against the schema that you have defined and take over the execution. Pretty much all of the JavaScript ecosystem uses GraphQL.js but there are many more implementations in other languages.
GraphQL Servers
GraphQL is also transport layer agnostic. That means that usually the GraphQL implementations don't come with an HTTP server. But often we use HTTP to make GraphQL queries, this is why there are some libraries that use these implementations and provide an easy way to create an HTTP server on top (e.g. by providing a middleware for an HTTP framework or coming with a whole server). I think in JavaScript pretty much everyone uses Apollo Server because it brings some more features and it integrates smothly with the Apollo ecosystem and the services offered by Apollo the company.
Apollo Server has also very much popularized the SDL (Schema Definition Language) approach of defining a GraphQL API. With the SDL approach the GraphQL schema is not created using code but by defining the Schema in a special language (also part of the GraphQL spec) and defining single resolver function seperately from that definition. This get's you started quickly but my feeling is that it is not very popular for large APIs. But you can simply pass your GraphQL.js schema to Apollo Server.
GraphQL Clients
When we have a server running we can make queries to the server using a simple HTTP client like the fetch function of the browser. That works pretty well but the power of GraphQL really shines when we use a client that supports caching an automatic query fetching when they are needed. This way we can reach the promised land of declarative data fetching / data dependencies. Facebook has published their own client library that is designed for the unique requirements of a large web enterprise. The library is called Relay and the newer version (breaking from the older version) is usually reffered to as Relay Modern. But Relay is relatively complicated and needs a specific build chain so that GraphQL became really interesting when Apollo released a lighweight client alternative known as Apollo Client. Apollo Client developed a lot over the years and now supports a lot of configuration. Also apollo-react allows to use Apollo Client with React whereas Relay is specifically built for React. With Apollo gaining quite some weight over the years the folks at Formidable Labs have created Urql.
Conclusion
You can use all of these technologies together. Many people simply chose to use the Apollo Ecosystem together, which is probably a solid choice. If you have used Redux before you will probably feel at home using Apollo Client or Urql. If you are building a large app with a performance focus you should consider Relay and understand what contrains this puts on the way you build the GraphQL schema.

Proxy API paths

I'm building an API using KOA and have read some best practise on versioning. This answer pointed out that versions should be hidden from the client.
My question is, how would I go about doing this? I've read some mentions of using an API proxy. Would I be using something like "Squid" as a reverse-proxy, or are there better Node/KOA specific solutions for this type of work?
I think GraphQL is the perfect tool to avoid pain in the ass with API.
Yes, in some point it breaks the REST philosophy but gives flexibility.
All you need to build a flexible API with no worry about version is: Koa, Objection + GraphQL.

Apollo GraphQL Server vs graphql-sequelize vs from scratch?

I'm a beginner to javascript and GraphQL, looking to implement a simple app that interacts with a MySQL database and wraps a 3rd party REST API. GraphQL seems like the right fit, and Javascript has first party support.
To get started, should I use Apollo's GraphQL Server or mickhansen's graphql-sequelize (with his dataloader-sequelize) or write one from scratch?
In all cases it seems to use sequelize under the hood, which mickhansen is a major contributor to.
I'm looking for the advice and analysis of more experienced javascript and GraphQL programmers.
I realise the final decision is subjective but I'm looking for a thought out pro/con of all 3 different solutions.
Thanks in advance!
I would recommend not to start writing your server from scratch, but to use existing libraries and seed projects. Personally, I use Typescript with the Apollo stack, combined with several other libraries for splitting the schema to files, and auto-generating types.
This post demonstrates how to modularize your graphql server code, providing a seed project you can clone. Hope it helps! :)
I am currently using Apollo GraphQL with Sequelize. Sequelize is your ORM to interact with the DB, it can function with Apollo which takes care of your GraphQL. GraphQL is a thin api layer anyway. One problem i have been running into is dataloader implementation with vanilla Sequelize. I am trying to figure it out to get it working. I am hoping to work through it this week.

Resources