()
| 193 | } |
| 194 | |
| 195 | func (p *parser) parseFragment() Selection { |
| 196 | _, comment := p.expect(lexer.Spread) |
| 197 | |
| 198 | if peek := p.peek(); peek.Kind == lexer.Name && peek.Value != "on" { |
| 199 | return &FragmentSpread{ |
| 200 | Position: p.peekPos(), |
| 201 | Comment: comment, |
| 202 | Name: p.parseFragmentName(), |
| 203 | Directives: p.parseDirectives(false), |
| 204 | } |
| 205 | } |
| 206 | |
| 207 | var def InlineFragment |
| 208 | def.Position = p.peekPos() |
| 209 | def.Comment = comment |
| 210 | if p.peek().Value == "on" { |
| 211 | p.next() // "on" |
| 212 | |
| 213 | def.TypeCondition = p.parseName() |
| 214 | } |
| 215 | |
| 216 | def.Directives = p.parseDirectives(false) |
| 217 | def.SelectionSet = p.parseRequiredSelectionSet() |
| 218 | return &def |
| 219 | } |
| 220 | |
| 221 | func (p *parser) parseFragmentDefinition() *FragmentDefinition { |
| 222 | var def FragmentDefinition |
no test coverage detected