![]() This requires far too much code to paste here, so I’ll do a little hand-waving around the rest and you can leave a comment if you want more details ? First, the C# GRPC server transforms the array of selections into a ResponsePlan. In this case, the PlayerData class has a parentID property which links it to the AccountData, so the Has Attribute is able to find all children. When its time for the GRPC server to hydrate the response objects, it is informed by these attributes. Specifically, I built Has, BelongsTo, and HasThrough. Fans of Ruby will notice how I modeled my C# Attributes off of ActiveRecord associations. The sixth, players, is an array of PlayerData objects which is hydrated by a call to another table. The first 5 properties ( username, password, salt, createdAt, updatedAt) are columns in the MySQL table. In this GraphQL query… query = new List() The ProblemĪs many have observed, GraphQL is basically RPC already. This means it’s a “code-once-and-forget” solution, with the GraphQL interface always kept up-to-date by the protobufs/IDL. Importantly, the GraphQL gateway is very thin it is informed entirely by the GRPC’s IDL. In this post, I’ll discuss how I built a C# server which serves GRPC calls over HTTP/2, and then added a Ruby on Rails gateway such that web (or other) clients could fall back on GraphQL over HTTP 1.1. I’ve long wondered if a server could easily allow the client to choose to use either. Each have their advantages and disadvantages. GRPC and GraphQL are both fantastic technologies.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |