code: func parseOperationDefinition(parser *Parser) (ast.Node, error) {
  	var (
  		operation           string
  		variableDefinitions []*ast.VariableDefinition
  		name                *ast.Name
  		directives          []*ast.Directive
  		selectionSet        *ast.SelectionSet
  		err                 error
  	)
  	start := parser.Token.Start
  	if peek(parser, lexer.BRACE_L) {
  		selectionSet, err := parseSelectionSet(parser)
  		if err != nil {
  			return nil, err
  		}
  		return ast.NewOperationDefinition(&ast.OperationDefinition{
  			Operation:    ast.OperationTypeQuery,
  			Directives:   []*ast.Directive{},
  			SelectionSet: selectionSet,
  			Loc:          loc(parser, start),
  		}), nil
  	}
  	if operation, err = parseOperationType(parser); err != nil {
  		return nil, err
  	}
  
  	if peek(parser, lexer.NAME) {
  		if name, err = parseName(parser); err != nil {
  			return nil, err
  		}
  	}
  	if variableDefinitions, err = parseVariableDefinitions(parser); err != nil {
  		return nil, err
  	}
  	if directives, err = parseDirectives(parser); err != nil {
  		return nil, err
  	}
  	if selectionSet, err = parseSelectionSet(parser); err != nil {
  		return nil, err
  	}
  	return ast.NewOperationDefinition(&ast.OperationDefinition{
  		Operation:           operation,
  		Name:                name,
  		VariableDefinitions: variableDefinitions,
  		Directives:          directives,
  		SelectionSet:        selectionSet,
  		Loc:                 loc(parser, start),
  	}), nil
  }
docs: /* Implements the parsing rules in the Operations section. */
  /**
   * OperationDefinition :
   *  - SelectionSet
   *  - OperationType Name? VariableDefinitions? Directives? SelectionSet
   */