In this example
We're stuck with having context dependent fields like `isTeamMember` which only makes sense when querying team members, and `hasTwoFactorEnabled` which should really only be available to your self (You dont want to be able to query that on all users)
-
-
Prikaži ovu nit
-
Solutions
1. The Relay Connection pattern is a powerful pattern to avoid that. `isTeamAdmin` would be a great fit for a field on an `Edge` type
2. We would still want a TeamMemberEdge, not a generic `UserEdge`
3. Maybe we actually needed both a `Viewer` and `TeamMember` typePrikaži ovu nit -
There's not a lot of cost to making specific types when needed: consider these potential problems when choosing the best type for a new field!
Even if types are the same at the moment doesn't mean they won't diverge in the future!Prikaži ovu nit -
Novi razgovor -
-
-
So fan of these threads, keep rocking it Marc
, can't wait to readhttps://productionreadygraphql.com/book - Kraj razgovora
Novi razgovor -
-
-
Exception: Input Types
-
Would love to
more of your thoughts on it
I see some arguments for both sides! - Još 1 odgovor
Novi razgovor -
-
-
All is ok here with sharing types. There is a problem only with isTeamAdmin field. It should be in Team type and named as isIamTeamAdmin (or something like that). User is a context type and must have no fields which depends on any other parent types except the context itself.
-
Oh, just noticed... your TeamMember solution is much better than i wrote before. Anyway GraphQL schema design should introduce new terms like: - context type - shareable type - namespace type - endpoint type - context depending field - parent type depending field etc
Kraj razgovora
Novi razgovor -
Čini se da učitavanje traje već neko vrijeme.
Twitter je možda preopterećen ili ima kratkotrajnih poteškoća u radu. Pokušajte ponovno ili potražite dodatne informacije u odjeljku Status Twittera.
APIs
Common
**Sharing types**
It's tempting to reuse types when they represent similar entities. For example team members can be "Users", just like the current authenticated viewer is a "User".
Truth is that they're maybe not the same thing 


