basic support for fragments

This commit is contained in:
Ben Kraft
2020-07-15 17:35:47 -07:00
parent 6f0e5fdf0d
commit a023cfb0cf
5 changed files with 83 additions and 29 deletions
+11
View File
@@ -0,0 +1,11 @@
fragment profileData on User {
name
emails
}
query {
user {
id
...profileData
}
}
+11
View File
@@ -0,0 +1,11 @@
type ProfileData struct {
Name *string `json:"name"`
Emails []string `json:"emails"`
}
type Response struct {
User *struct {
Id string `json:"id"`
ProfileData
} `json:"user"`
}