-
Notifications
You must be signed in to change notification settings - Fork 311
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: preflight check all request methods (#1278)
- Loading branch information
1 parent
82fba60
commit fa687d6
Showing
665 changed files
with
22,743 additions
and
16,624 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/** | ||
* This example shows use of the `minimal` preset which is the | ||
* default preset used when importing Graffle. It bundles the | ||
* Transport HTTP extension. | ||
*/ | ||
|
||
import { Graffle } from '../../src/entrypoints/main.js' | ||
import { create } from '../../src/entrypoints/presets/minimal.js' | ||
|
||
console.log(`Is the default preset`, Graffle.create === create) | ||
|
||
const graffle = create() | ||
|
||
console.log(`The current transport is`, graffle._.transports.current) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/** | ||
* This example shows use of the `bare` preset which is Graffle at | ||
* its most minimal. It uses no extensions, not even a transport. | ||
*/ | ||
|
||
import { create } from '../../src/entrypoints/presets/bare.js' | ||
import { Introspection } from '../../src/extensions/Introspection/Introspection.js' | ||
|
||
const graffle = create() | ||
|
||
/** | ||
* Because we have no transports registered, the `transport` method | ||
* is not available to us. Nor are the request methods. | ||
* | ||
* As well, request methods from extensions also check the status of the transport. | ||
*/ | ||
|
||
const _t: never = graffle.transport | ||
const _e1: 'Error: You cannot send requests yet. You must setup a transport.' = graffle.gql | ||
const _e2: 'Error: You cannot send requests yet. You must setup a transport.' = graffle.document | ||
const _e3: 'Error: You cannot send requests yet. You must setup a transport.' = graffle.query.$batch | ||
const _e4: 'Error: You cannot send requests yet. You must setup a transport.' = graffle.query.id | ||
const _e5: 'Error: You cannot send requests yet. You must setup a transport.' = graffle.mutation.$batch | ||
const _e6: 'Error: You cannot send requests yet. You must setup a transport.' = graffle.mutation.id | ||
const _e7: 'Error: You cannot send requests yet. You must setup a transport.' = graffle.use(Introspection()).introspect |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,4 @@ Headers { | |
'content-type': 'application/json', | ||
authorization: 'Bearer MY_TOKEN', | ||
'x-from-raw': 'true' | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Is the default preset true | ||
The current transport is http |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.