The Do’s and Don’ts for your schema and GraphQL operations
ฝัง
- เผยแพร่เมื่อ 29 ก.ค. 2024
- Learn GraphQL with Apollo Odyssey, our hands-on training and tutorial course platform - odyssey.apollographql.com/
Learn from our Apollo Docs - www.apollographql.com/docs/
What’s the easiest way to navigate your schema and query your graph? Try Apollo Studio at www.apollographql.com/studio/...
Video Details: Learn best practices for GraphQL schema and client operations from someone who works with enterprises every day to optimize their GraphQL infrastructure - Michael Watson, an Apollo Customer Success Engineer.
Start with common do's and don'ts for building a schema that will help clients more easily consume your graph. Then look at common pitfalls Michael sees in GraphQL operations and how some small changes can bring a lot of clarity to a data graph. Micheal also covers Apollo tooling, like Graph Manager, to enable these best practices.
Resources:
Checkout the Apollo docs - www.apollographql.com/docs/
Explore the schema docs - www.apollographql.com/docs/ap...
Explore the GraphQL FAQs - www.apollographql.com/docs/re... - วิทยาศาสตร์และเทคโนโลยี
And the rabbit hole never ends!!!! Thanks Michael for turning on the lights for a lot more rooms to explore!!!!
As a software developer this guy is a great salesman (for the tools he wants people to use). Maybe he isn't doing in purpose, but he would do great in sales 😄
"Be a champ for my project"
"Do not use basic software, use our services"
Watson's the best
This was entirely a marketing presentation. I was hoping to learn something about the ins and outs of schema design but it really comes down to "hey look at what our tooling and platform can give you".
You go Michael Watson!
Could we please get a code example for filtering criteria as variables for the graph?
I'm trying to figure out how to sort by asc in my resolver, on a subdocument
Kitchen Schema, { itemCategory } and { itemName }, can sort by directly querying the Kitchen Schema, but when quiring the context user, (me) and the subdocument field kitchen ref: 'Kitchen'. the itemCategory and itemName are not sorting at all.
So it seems GraphQL should cater to the client(s).
One specific thing I have in mind, in storing monetary data. We believe it would be best to store it in "cents" as an integer ie 3500 = $35, 3555 = $35.55.
With that in mind, should GraphQL input/output monetary values as Int or a Float as that is what the client would be using?
I don't work at Apollo, but I think you should use integers. While the graph can make things easier for clients, it shouldn't make things ambiguous or wrong.
Hey, use integers. Is the way stripe does it and is really great
We input as integer, and output as a type called Money. This Money type contains several fields: currency, formatted amount (which is a string like "€5.00") and lastly: amount (which is the original input as an integer).
basically its the same as monogdb lol.. cater the api/db to the calls
The one single downvote is from a REST sympathiser.
Jokes aside, good talk.