GraphQL\Validator\Rules\OverlappingFieldsCanBeMerged::fieldsConflictMessage PHP Method

fieldsConflictMessage() static public method

static public fieldsConflictMessage ( $responseName, $reason )
    static function fieldsConflictMessage($responseName, $reason)
    {
        $reasonMessage = self::reasonMessage($reason);
        return "Fields \"{$responseName}\" conflict because {$reasonMessage}.";
    }

Usage Example

    public function testComparesDeepTypesIncludingList()
    {
        $this->expectFailsRuleWithSchema($this->getTestSchema(), new OverlappingFieldsCanBeMerged(), '
        {
          connection {
            ...edgeID
            edges {
              node {
                id: name
              }
            }
          }
        }

        fragment edgeID on Connection {
          edges {
            node {
              id
            }
          }
        }
      ', [FormattedError::create(OverlappingFieldsCanBeMerged::fieldsConflictMessage('edges', [['node', [['id', 'id and name are different fields']]]]), [new SourceLocation(14, 11), new SourceLocation(5, 13), new SourceLocation(15, 13), new SourceLocation(6, 15), new SourceLocation(16, 15), new SourceLocation(7, 17)])]);
    }