Referencing:
Is there any update on being able to store Fragments on the Server Side specifically in the Slash? We are building out multiple UI to access the same DB. It would be nice if we didn’t have to redefine the fragments in each UI but rather could just expand fragments that are stored on the server side.
Proposed Schema
type Person {
id: ID
name: String
hasFriends: [Person]
hasAddresses: [Address]
}
type Address {
id: ID
line1: String
city: String
state: String
zip: String
country: String
}
fragment FullAddress on Address {
id
line1
city
state
zip
country
}
fragment AddressAndFriendWithAddress on Person {
hasAddresses {
...FullAddress
}
hasFriends {
id
name
hasAddresses {
...FullAddress
}
}
}
Then I could run a query like:
query {
getPerson(id: ["0x2"]) {
id
name
...AddressAndFriendWithAddress
}
}
Without this, I have to send the fragments on the client side every time which looks like:
query {
getPerson(id: ["0x2"]) {
id
name
...AddressAndFriendWithAddress
}
}
fragment FullAddress on Address {
id
line1
city
state
zip
country
}
fragment AddressAndFriendWithAddress on Person {
hasAddresses {
...FullAddress
}
hasFriends {
id
name
hasAddresses {
...FullAddress
}
}
}