Skip to content

Commit

Permalink
try .ts extension
Browse files Browse the repository at this point in the history
  • Loading branch information
sikanhe committed Dec 5, 2023
1 parent b3f5115 commit ea94d73
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import type {
GqlContext,
UnionType,
InterfaceType,
} from './types.js';
} from './types.ts';

export function buildGraphQLSchema<RootSrc>(
schema: Schema<RootSrc>
Expand Down
2 changes: 1 addition & 1 deletion src/define.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import type {
SubscriptionObjectType,
PromiseOrValue,
GqlContext,
} from './types.js';
} from './types.ts';

type ExtensionsMap = {
field?: {
Expand Down
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export type * from './types.js';
export { Gql } from './define.js';
export type * from './types.ts';
export { Gql } from './define.ts';
export {
buildGraphQLSchema,
toGraphQLInputType,
toGraphQLOutputType,
} from './build.js';
} from './build.ts';
4 changes: 2 additions & 2 deletions src/relay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import type {
TOfArgMap,
GqlContext,
ObjectType,
} from './types.js';
import { Gql } from './define.js';
} from './types.ts';
import { Gql } from './define.ts';
import { GraphQLResolveInfo } from 'graphql';

// Adapted from
Expand Down
4 changes: 2 additions & 2 deletions test-api/api.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Gql, ObjectType } from '../src';
import { Gql, ObjectType } from '../src/index.ts';

declare module '../src/types' {
declare module '../src/types.ts' {
interface Context {
contextContent: string;
}
Expand Down
5 changes: 3 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"compilerOptions": {
"target": "ES2019",
"module": "ESNext",
"moduleResolution": "node",
"moduleResolution": "NodeNext",
"rootDir": "src",
"outDir": "dist",
"declaration": true,
Expand All @@ -13,7 +13,8 @@
"noUnusedParameters": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"skipLibCheck": true
"skipLibCheck": true,
"allowImportingTsExtensions": true,
},
"files": ["./src/index.ts", "./src/relay.ts"]
}

1 comment on commit ea94d73

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes have been published to npm.

yarn add -E gqtx@0.9.1-ea94d732.0

Please sign in to comment.