func TestValidate_OverlappingFieldsCanBeMerged_ReturnTypesMustBeUnambiguous_ComparesDeepTypesIncludingList(t *testing.T) {
	testutil.ExpectFailsRuleWithSchema(t, &schema, graphql.OverlappingFieldsCanBeMergedRule, `
        {
          connection {
            ...edgeID
            edges {
              node {
                id: name
              }
            }
          }
        }

        fragment edgeID on Connection {
          edges {
            node {
              id
            }
          }
        }
    `, []gqlerrors.FormattedError{
		testutil.RuleError(
			`Fields "edges" conflict because subfields "node" conflict because subfields "id" conflict because `+
				`id and name are different fields.`,
			14, 11,
			15, 13,
			16, 15,
			5, 13,
			6, 15,
			7, 17),
	})
}
func TestValidate_OverlappingFieldsCanBeMerged_ReturnTypesMustBeUnambiguous_DisallowsDifferingDeepReturnTypesDespiteNoOverlap(t *testing.T) {
	testutil.ExpectFailsRuleWithSchema(t, &schema, graphql.OverlappingFieldsCanBeMergedRule, `
        {
          someBox {
            ... on IntBox {
              box: stringBox {
                scalar
              }
            }
            ... on StringBox {
              box: intBox {
                scalar
              }
            }
          }
        }
    `, []gqlerrors.FormattedError{
		testutil.RuleError(
			`Fields "box" conflict because subfields "scalar" conflict because they return conflicting types String and Int.`,
			5, 15,
			6, 17,
			10, 15,
			11, 17),
	})
}
func TestValidate_OverlappingFieldsCanBeMerged_ReturnTypesMustBeUnambiguous_DisallowsDifferingReturnTypeNullabilityDespiteNoOverlap(t *testing.T) {
	testutil.ExpectFailsRuleWithSchema(t, &schema, graphql.OverlappingFieldsCanBeMergedRule, `
        {
          someBox {
            ... on NonNullStringBox1 {
              scalar
            }
            ... on StringBox {
              scalar
            }
          }
        }
    `, []gqlerrors.FormattedError{
		testutil.RuleError(
			`Fields "scalar" conflict because they return conflicting types String! and String.`,
			5, 15,
			8, 15),
	})
}
func TestValidate_OverlappingFieldsCanBeMerged_ReturnTypesMustBeUnambiguous_ConflictingReturnTypesWhichPotentiallyOverlap(t *testing.T) {
	// This is invalid since an object could potentially be both the Object
	// type IntBox and the interface type NonNullStringBox1. While that
	// condition does not exist in the current schema, the schema could
	// expand in the future to allow this. Thus it is invalid.
	testutil.ExpectFailsRuleWithSchema(t, &schema, graphql.OverlappingFieldsCanBeMergedRule, `
        {
          someBox {
            ...on IntBox {
              scalar
            }
            ...on NonNullStringBox1 {
              scalar
            }
          }
        }
    `, []gqlerrors.FormattedError{
		testutil.RuleError(
			`Fields "scalar" conflict because they return conflicting types Int and String!.`,
			5, 15,
			8, 15),
	})
}
func TestValidate_OverlappingFieldsCanBeMerged_ReturnTypesMustBeUnambiguous_DisallowsDifferingSubfields(t *testing.T) {
	testutil.ExpectFailsRuleWithSchema(t, &schema, graphql.OverlappingFieldsCanBeMergedRule, `
        {
          someBox {
            ... on IntBox {
              box: stringBox {
                val: scalar
                val: unrelatedField
              }
            }
            ... on StringBox {
              box: stringBox {
                val: scalar
              }
            }
          }
        }
    `, []gqlerrors.FormattedError{
		testutil.RuleError(
			`Fields "val" conflict because scalar and unrelatedField are different fields.`,
			6, 17,
			7, 17),
	})
}