Skip to content

Commit

Permalink
Fix TypeScript type definitions for graphql-sequelize
Browse files Browse the repository at this point in the history
  • Loading branch information
Glavin001 committed Oct 15, 2017
1 parent 89b6091 commit abfe614
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 7 deletions.
2 changes: 2 additions & 0 deletions index.d.ts
@@ -0,0 +1,2 @@
/// <reference path="./src/@types/graphql-sequelize/index.d.ts" />
export * from "./dist/src";
5 changes: 3 additions & 2 deletions package.json
Expand Up @@ -2,15 +2,16 @@
"name": "graphql-sequelize-crud",
"version": "0.4.0",
"description": "Automatically generate queries and mutations from Sequelize models",
"main": "./dist/src/index.js",
"main": "./dist/src/index",
"types": "./dist/src/index.d.ts",
"directories": {
"test": "test",
"lib": "dist",
"example": "demo"
},
"files": [
"dist/src"
"dist/src",
"src/@types"
],
"scripts": {
"prepublishOnly": "npm run build",
Expand Down
Expand Up @@ -4,16 +4,13 @@ declare module "graphql-sequelize" {
import {
GraphQLFieldResolver,
GraphQLFieldConfigArgumentMap,
GraphQLFieldConfig,
GraphQLFieldConfigMap,
GraphQLInputFieldConfigMap,
GraphQLObjectType,
GraphQLInputObjectType,
} from "graphql";
import { ConnectionConfig } from "graphql-relay";
import { Sequelize } from "sequelize";
import { Model as SequelizeModel } from "sequelize";
import { SequelizeConnection } from "graphql-sequelize";
import { Sequelize, Model as SequelizeModel } from "sequelize";

export interface Model extends SequelizeModel<any, any> {
associations: {
Expand Down
2 changes: 2 additions & 0 deletions src/@types/index.d.ts
@@ -0,0 +1,2 @@
// tslint:disable no-reference no-useless-files
/// <reference path="./graphql-sequelize/index.d.ts" />
3 changes: 3 additions & 0 deletions src/OperationFactory.ts
@@ -1,3 +1,6 @@
// tslint:disable-next-line:no-reference
/// <reference path="./@types/graphql-sequelize/index.d.ts" />

import {
GraphQLObjectType,
GraphQLInt,
Expand Down
3 changes: 3 additions & 0 deletions src/getSchema.ts
@@ -1,3 +1,6 @@
// tslint:disable-next-line:no-reference
/// <reference path="./@types/graphql-sequelize/index.d.ts" />

import {
GraphQLObjectType,
GraphQLSchema,
Expand Down
3 changes: 3 additions & 0 deletions src/types.ts
@@ -1 +1,4 @@
// tslint:disable-next-line:no-reference
/// <reference path="./@types/index.d.ts" />

export { Model, Association, ModelsHashInterface, ModelTypes } from "graphql-sequelize";
16 changes: 15 additions & 1 deletion tsconfig.json
Expand Up @@ -15,8 +15,22 @@
"es6",
"dom",
"esnext"
]
],
"paths": {
"graphql-sequelize/*": [
"src/@types/graphql-sequelize/*"
]
},
"baseUrl": "."
},
"files": [
"src/@types/graphql-sequelize/index.d.ts"
],
"include": [
"demo",
"src",
"test"
],
"exclude": [
"node_modules",
"dist"
Expand Down

0 comments on commit abfe614

Please sign in to comment.