mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-12 04:50:18 +00:00
add graphql-fields typings
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
import { GraphQLResolveInfo } from 'graphql';
|
||||
import graphqlFields = require('graphql-fields');
|
||||
|
||||
const info = ({} as any) as GraphQLResolveInfo;
|
||||
|
||||
const fieldsWithSubFieldsArgs = graphqlFields(info, {}, { processArguments: true });
|
||||
const fieldsWithoutTypeName = graphqlFields(info, {}, { excludedFields: ['__typename'] });
|
||||
graphqlFields(info);
|
||||
Vendored
+18
@@ -0,0 +1,18 @@
|
||||
// Type definitions for graphql-fields 1.3
|
||||
// Project: https://github.com/robrichard/graphql-fields#readme
|
||||
// Definitions by: feinoujc <https://github.com/feinoujc>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
|
||||
import { GraphQLResolveInfo } from 'graphql';
|
||||
|
||||
declare function graphqlFields(info: GraphQLResolveInfo, obj?: object, opts?: graphqlFields.Options): any;
|
||||
|
||||
declare namespace graphqlFields {
|
||||
interface Options {
|
||||
processArguments?: boolean;
|
||||
excludedFields?: string[];
|
||||
}
|
||||
}
|
||||
|
||||
export = graphqlFields;
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"esnext.asynciterable"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"graphql-fields-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user