Exemple #1
0
 /**
  * Corresponds to both FragmentSpread and InlineFragment in the spec.
  *
  * @return \Fubhy\GraphQL\Language\Node\FragmentSpread|\Fubhy\GraphQL\Language\Node\InlineFragment
  */
 protected function parseFragment()
 {
     $start = $this->token->getStart();
     $this->expect(Token::SPREAD_TYPE);
     if ($this->token->getValue() === 'on') {
         $this->advance();
         return new InlineFragment($this->parseNamedType(), $this->parseDirectives(), $this->parseSelectionSet(), $this->location($start));
     }
     return new FragmentSpread($this->parseFragmentName(), $this->parseDirectives(), $this->location($start));
 }