This repository has been archived by the owner on Mar 20, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 538
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6a1e317
commit 227093d
Showing
7 changed files
with
83 additions
and
18 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
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,30 @@ | ||
// @noflow | ||
|
||
'use strict'; | ||
|
||
const fs = require('fs'); | ||
const path = require('path'); | ||
|
||
const { exec, rmdirRecursive, readdirRecursive } = require('./utils'); | ||
|
||
rmdirRecursive('./tmp'); | ||
fs.mkdirSync('./tmp'); | ||
fs.mkdirSync('./tmp/__tests__'); | ||
|
||
const srcFiles = readdirRecursive('./src'); | ||
for (const filepath of srcFiles) { | ||
const srcPath = path.join('./src', filepath); | ||
const destPath = path.join('./tmp', filepath); | ||
|
||
if (filepath.endsWith('.ts')) { | ||
fs.copyFileSync(srcPath, destPath); | ||
} | ||
} | ||
|
||
fs.copyFileSync('tsconfig.json', path.join('./tmp', 'tsconfig.json')); | ||
|
||
try { | ||
exec('dtslint tmp', { stdio: 'inherit' }); | ||
} finally { | ||
rmdirRecursive('./tmp'); | ||
} |
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,7 @@ | ||
import { IncomingMessage } from 'http'; | ||
|
||
export {}; | ||
|
||
type Request = IncomingMessage & { body?: unknown }; | ||
|
||
export function parseBody(req: Request): Promise<{ [param: string]: unknown }>; |
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,29 @@ | ||
import { ExecutionResult } from 'graphql'; | ||
|
||
export interface GraphiQLData { | ||
query?: string | null; | ||
variables?: { readonly [name: string]: unknown } | null; | ||
operationName?: string | null; | ||
result?: ExecutionResult; | ||
} | ||
|
||
export interface GraphiQLOptions { | ||
/** | ||
* An optional GraphQL string to use when no query is provided and no stored | ||
* query exists from a previous session. If undefined is provided, GraphiQL | ||
* will use its own default query. | ||
*/ | ||
defaultQuery?: string; | ||
} | ||
|
||
/** | ||
* When express-graphql receives a request which does not Accept JSON, but does | ||
* Accept HTML, it may present GraphiQL, the in-browser GraphQL explorer IDE. | ||
* | ||
* When shown, it will be pre-populated with the result of having executed the | ||
* requested query. | ||
*/ | ||
export function renderGraphiQL( | ||
data: GraphiQLData, | ||
options?: GraphiQLOptions, | ||
): string; |
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