A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/graphql/graphql-spec/commit/994ba71790796d08864ef11706d55db929e258d8 below:

Add language to ensure fragments are unique within a document · graphql/graphql-spec@994ba71 · GitHub

File tree Expand file treeCollapse file tree 1 file changed

+54

-0

lines changed

Filter options

Expand file treeCollapse file tree 1 file changed

+54

-0

lines changed Original file line number Diff line number Diff line change

@@ -448,6 +448,60 @@ fragment missingRequiredArg on Arguments {

448 448 449 449

### Fragment Declarations

450 450 451 +

#### Fragment Name Uniqueness

452 + 453 +

** Formal Specification **

454 + 455 +

* For each fragment definition {fragment} in the document

456 +

* Let {fragmentName} be the name of {fragment}.

457 +

* Let {fragments} be all fragment definitions in the document named {fragmentName}.

458 +

* {fragments} must be a set of one.

459 + 460 +

** Explanatory Text **

461 + 462 +

Fragment definitions are referenced in fragment spreads by name. To avoid

463 +

ambiguity, each fragment's name must be unique within a document.

464 + 465 +

Inline fragments are not considered fragment definitions, and unaffected by this

466 +

validation rule.

467 + 468 +

For example the following document is valid:

469 + 470 +

```graphql

471 +

{

472 +

...fragmentOne

473 +

...fragmentTwo

474 +

}

475 + 476 +

fragment fragmentOne on Dog {

477 +

name

478 +

}

479 + 480 +

fragment fragmentTwo on Dog {

481 +

owner {

482 +

name

483 +

}

484 +

}

485 +

```

486 + 487 +

While this document is invalid:

488 + 489 +

```graphql

490 +

{

491 +

...fragmentOne

492 +

}

493 + 494 +

fragment fragmentOne on Dog {

495 +

name

496 +

}

497 + 498 +

fragment fragmentOne on Dog {

499 +

owner {

500 +

name

501 +

}

502 +

}

503 +

```

504 + 451 505

#### Fragment Spread Type Existence

452 506 453 507

** Formal Specification **

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4