Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@ You can also use the export `jsonSchemaBuilder` to get your own copy of the Grap
In node:
```js
import {graphql} from 'graphql';
import {jsonSchemaBuilder} from 'json-graphql-server';
import {jsonSchemaBuilder} from 'json-graphql-server/node';

const data = { };
const schema = jsonSchemaBuilder(data);
Expand All @@ -616,7 +616,7 @@ This uses the export `getPlainSchema`.
import { ApolloServer } from 'apollo-server';
import { makeExecutableSchema } from '@graphql-tools/schema'; // or graphql-tools
import { applyMiddleware } from 'graphql-middleware';
import { getPlainSchema } from 'json-graphql-server';
import { getPlainSchema } from 'json-graphql-server/node';

const data = { };

Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@
"module": "./dist/json-graphql-server.js",
"exports": {
".": {
"types": "./dist/client.d.ts",
"import": "./dist/json-graphql-server.js",
"require": "./dist/json-graphql-server.cjs"
},
"./node": {
"types": "./dist/node.d.ts",
"import": "./dist/json-graphql-server-node.js",
"require": "./dist/json-graphql-server-node.cjs"
}
Expand All @@ -34,7 +36,7 @@
"test": "cross-env NODE_ENV=test vitest",
"server": "node ./bin/json-graphql-server.cjs example/data.cjs",
"prepublish": "yarn build",
"build": "yarn build-ts && yarn build-esm-cjs && yarn build-node && yarn build-umd",
"build": "yarn build-esm-cjs && yarn build-node && yarn build-umd && yarn build-ts",
"build-ts": "tsc",
"build-esm-cjs": "vite build",
"build-node": "vite build -c ./vite.config.node.js",
Expand Down
5 changes: 4 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@
"resolveJsonModule": true,
"isolatedModules": true,
"moduleDetection": "force",
"noEmit": true,
"emitDeclarationOnly": true,
"declaration": true,
"declarationMap": true,
"outDir": "./dist",

/* Linting */
"strict": true,
Expand Down
1 change: 1 addition & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export default defineConfig({
entry: resolve(__dirname, 'src/client.ts'),
name: 'JsonGraphqlServer',
formats: ['es', 'cjs'],
fileName: 'json-graphql-server',
},
sourcemap: true,
minify: process.env.NODE_ENV === 'production',
Expand Down