OverlappingFieldsCanBeMerged.d.ts 711 B

123456789101112131415161718192021222324
  1. import { ASTVisitor } from '../../language/visitor';
  2. import { ValidationContext } from '../ValidationContext';
  3. export function fieldsConflictMessage(
  4. responseName: string,
  5. reason: ConflictReasonMessage,
  6. ): string;
  7. /**
  8. * Overlapping fields can be merged
  9. *
  10. * A selection set is only valid if all fields (including spreading any
  11. * fragments) either correspond to distinct response names or can be merged
  12. * without ambiguity.
  13. */
  14. export function OverlappingFieldsCanBeMerged(
  15. context: ValidationContext,
  16. ): ASTVisitor;
  17. // Field name and reason.
  18. type ConflictReason = [string, string];
  19. // Reason is a string, or a nested list of conflicts.
  20. type ConflictReasonMessage = string | Array<ConflictReason>;