ghql fragment class
Examples
# make a fragment class
frag <- Fragment$new()
# define a fragment
frag$fragment('Watchers', '
fragment on Repository {
watchers(first: 3) {
edges {
node {
name
}
}
}
}')
# define another fragment
frag$fragment('Stargazers', '
fragment on Repository {
stargazers(first: 3) {
edges {
node {
name
}
}
}
}')
frag
#> <ghql: fragment>
#> fragments:
#> Watchers
#> Stargazers
frag$fragments
#> $Watchers
#> fragment on Repository {
#> watchers(first: 3) {
#> edges {
#> node {
#> name
#> }
#> }
#> }
#> }
#>
#> $Stargazers
#> fragment on Repository {
#> stargazers(first: 3) {
#> edges {
#> node {
#> name
#> }
#> }
#> }
#> }
#>
frag$fragments$Watchers
#> fragment on Repository {
#> watchers(first: 3) {
#> edges {
#> node {
#> name
#> }
#> }
#> }
#> }
frag$fragments$Stargazers
#> fragment on Repository {
#> stargazers(first: 3) {
#> edges {
#> node {
#> name
#> }
#> }
#> }
#> }