Fragment: Fragment

Description Value Public fields Methods Examples

Description

ghql fragment class

Value

a 'Fragment' class (R6 class)

Public fields

fragments

(list) list of fragments

Methods

Public methods


Method print()

print method for the 'Fragment' class

Usage
Fragment$print(x, ...)
Arguments
x

self

...

ignored


Method fragment()

create a fragment by name

Usage
Fragment$fragment(name, x)
Arguments
name

(character) fragment name

x

(character) the fragment

Returns

nothing returned; sets fragments internally

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# 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
frag$fragments
frag$fragments$Watchers
frag$fragments$Stargazers

ghql documentation built on March 26, 2020, 6:26 p.m.