GraphQL Unions Tutorial

  Рет қаралды 8,825

Ben Awad

Ben Awad

Күн бұрын

Пікірлер: 23
@_patrickisaac
@_patrickisaac 4 жыл бұрын
From a junior dev perspective: I watched this video about a few months back and sort of understood it and I re-watched it again today and it makes complete sense. I just wanted to take the time to say thank you so much for this, Ben!
@akasadulloh3393
@akasadulloh3393 2 жыл бұрын
O men thank you so much. It's hard to find docs about union types usage. It's very helpful!
@prvnbist
@prvnbist 5 жыл бұрын
Hey, Really nice tutorial about Union Types. Could you also do one for Enums whenever it's convenient for you?
@bawad
@bawad 5 жыл бұрын
sure
@sanchito59
@sanchito59 4 жыл бұрын
Great video, thanks for this!
@sasonbraha4599
@sasonbraha4599 5 жыл бұрын
Awesome video! thanks.
@kamleshshete6948
@kamleshshete6948 3 жыл бұрын
Thanks for the tutorial and I watched many other Ur tutorial ..... Great work .Thank you very much Ben I have one question can we give multiple scalar type for fields in schema Like type user name : Int I String l Date } Is it possible to give multiple scale types ???
@kamleshshete6948
@kamleshshete6948 3 жыл бұрын
And my second question is Graphql is it have really have performance and other benefits over rest API for small applications with 1k or 10k users ? And many cases need third party library support , ex: for file upload We can't test directly from GraphQL playground need to install some third party library ?
@iljushka7198
@iljushka7198 5 жыл бұрын
Used it once for search feature
@yoyo26-34
@yoyo26-34 5 жыл бұрын
Hi, thks but I guess it would me more powerfull if the union type returns the same fields names whatever the error type is triggered. Would be much easier on the client side to manager the errors. All in all this is all about standardizing the errors signatures thks ben
@akashrajpurohit97
@akashrajpurohit97 5 жыл бұрын
What would you do while implementing the client side of it. Because you are not sure whether you will get an error object with reason or with field key on it. Would you have to keep a check something like if(err && err.field) validationErrorRes if(err && err.reason) timeoutErrorRes Something like this or different sol?
@bawad
@bawad 5 жыл бұрын
yes or you can check the __typename
@akashrajpurohit97
@akashrajpurohit97 5 жыл бұрын
@@bawad Cool
@anikethsaha5064
@anikethsaha5064 5 жыл бұрын
Can they b used for auth? Like if my auth attempt is correct then return the user else the error?...
@bawad
@bawad 5 жыл бұрын
yes
@natture
@natture 4 жыл бұрын
how is that toggling happing can anyone tell i
@bawad
@bawad 4 жыл бұрын
Toggling between screens? That's control + left or right arrow key on mac
@riginoommen
@riginoommen 4 жыл бұрын
How to use unions with input types
@AsifIqbalR
@AsifIqbalR 4 жыл бұрын
You can't.
@franciscobanda5213
@franciscobanda5213 5 жыл бұрын
Hi Ben, How would I structure my resolvers const for the following scenario? My schema looks likes this: const schema = gql ` type Query { search(text: String!): [SearchResults!] union SearchResults = User | Transaction | Message type User { logonID: ID! fullName: String! surName: String! } type Transaction{ transactionType: String platformName: String } type Message{ fullText: String! description: String! } ` const resolvers = { Query : { search: () => { } }, SearchResults: { __resolveType: obj => { if(obj.logonID){ return "User" } if(obj.transactionType){ return "Transaction" } if(obj.fullText){ return "Message" } return null } } }
@franciscobanda5213
@franciscobanda5213 5 жыл бұрын
I understand that for each Union Type there needs to be a resolveType to distinguish which data type will come back however I'm unclear as to how initial Query Resolver connects to it.
@bawad
@bawad 5 жыл бұрын
what do you mean by the initial query resolver? like your unsure what your search resolver should look like?
@scottamolinari
@scottamolinari 4 жыл бұрын
Am I the only one that isn't getting any sound?
Normalizing Data from Multiple APIs in GraphQL
25:11
Ben Awad
Рет қаралды 8 М.
GraphQL Basic Types
19:07
Ben Awad
Рет қаралды 29 М.
2 MAGIC SECRETS @denismagicshow @roman_magic
00:32
MasomkaMagic
Рет қаралды 32 МЛН
the balloon deflated while it was flying #tiktok
00:19
Анастасия Тарасова
Рет қаралды 36 МЛН
They Chose Kindness Over Abuse in Their Team #shorts
00:20
I migliori trucchetti di Fabiosa
Рет қаралды 11 МЛН
Elza love to eat chiken🍗⚡ #dog #pets
00:17
ElzaDog
Рет қаралды 24 МЛН
Introducing entity interfaces
6:04
Apollo GraphQL
Рет қаралды 3,3 М.
Guide to the GraphQL Ecosystem
19:47
Ben Awad
Рет қаралды 60 М.
GraphQL input and union schema types [Advanced GraphQL schema] #2
9:29
Tech With Piotr
Рет қаралды 1,5 М.
How GraphQL Resolvers Work
15:12
Ben Awad
Рет қаралды 41 М.
05 GraphQL  Object types in graphql
7:51
Bitfumes
Рет қаралды 2,7 М.
My GraphQL Performance Problem
13:33
Ben Awad
Рет қаралды 49 М.
GraphQL JWT Authentication Implementation
19:00
Ben Awad
Рет қаралды 44 М.
GraphQL N+1 Problem
16:14
Ben Awad
Рет қаралды 110 М.
15 GraphQL  enum type
9:23
Bitfumes
Рет қаралды 3,4 М.
2 MAGIC SECRETS @denismagicshow @roman_magic
00:32
MasomkaMagic
Рет қаралды 32 МЛН