Initialisation
Added the packages and files for the backend server
This commit is contained in:
30
node_modules/@apollo/utils.dropunuseddefinitions/README.md
generated
vendored
Normal file
30
node_modules/@apollo/utils.dropunuseddefinitions/README.md
generated
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
# dropUnusedDefinitions
|
||||
|
||||
Given an operation document and an operation name, this function will return a
|
||||
new document with only the definitions required for the operation name provided.
|
||||
|
||||
If the provided operation name doesn't match any operation in the document,
|
||||
`dropUnusedDefinitions` will return the original document.
|
||||
|
||||
## Usage
|
||||
|
||||
```ts
|
||||
import { dropUnusedDefinitions } from "@apollo/utils.dropunuseddefinitions";
|
||||
|
||||
const operation = parse(`#graphql
|
||||
query Drop { ...DroppedFragment }
|
||||
fragment DroppedFragment on Query { abc }
|
||||
query Keep { ...KeptFragment }
|
||||
fragment KeptFragment on Query { def }
|
||||
`);
|
||||
const keepOperation = dropUnusedDefinitions(operation, "Keep");
|
||||
/**
|
||||
query Keep {
|
||||
...KeptFragment
|
||||
}
|
||||
|
||||
fragment KeptFragment on Query {
|
||||
def
|
||||
}
|
||||
*/
|
||||
```
|
||||
Reference in New Issue
Block a user