@elysiajs/apollo
Advanced tools
Comparing version 0.8.0 to 1.0.0-beta.0
@@ -1,2 +0,1 @@ | ||
/// <reference types="bun-types" /> | ||
import type { Context, Elysia } from 'elysia'; | ||
@@ -12,4 +11,4 @@ import { ApolloServer, BaseContext, type ApolloServerOptions } from '@apollo/server'; | ||
export declare class ElysiaApolloServer<Context extends BaseContext = BaseContext> extends ApolloServer<Context> { | ||
createHandler<Path extends string = '/graphql'>({ path, enablePlayground, context }: ServerRegistration<Path>): Promise<(app: Elysia) => Elysia<"", { | ||
request: {}; | ||
createHandler<Path extends string = '/graphql'>({ path, enablePlayground, context }: ServerRegistration<Path>): Promise<(app: Elysia) => Elysia<"", false, { | ||
decorator: {}; | ||
store: {}; | ||
@@ -21,3 +20,6 @@ derive: {}; | ||
error: {}; | ||
}, {}, {}, { [path in `${Path}`]: { | ||
}, { | ||
schema: {}; | ||
macro: {}; | ||
}, {} & import("elysia/dist/dynamic-handle-rcjNUgOk").af<`${Path}`, { | ||
post: { | ||
@@ -29,3 +31,3 @@ body: { | ||
}; | ||
params: Path extends `${string}/:${string}` | `${string}/*${string}` ? Record<import("elysia/dist/types").GetPathParameter<Path>, string> : never; | ||
params: Record<import("elysia/dist/dynamic-handle-rcjNUgOk").G<Path>, string>; | ||
query: unknown; | ||
@@ -37,20 +39,6 @@ headers: unknown; | ||
}; | ||
}; } extends infer T ? { [K in keyof T]: { [path in `${Path}`]: { | ||
post: { | ||
body: { | ||
operationName?: string | null | undefined; | ||
variables?: {} | undefined; | ||
query: string; | ||
}; | ||
params: Path extends `${string}/:${string}` | `${string}/*${string}` ? Record<import("elysia/dist/types").GetPathParameter<Path>, string> : never; | ||
query: unknown; | ||
headers: unknown; | ||
response: { | ||
200: Promise<Response>; | ||
}; | ||
}; | ||
}; }[K]; } : never, false>>; | ||
}>>>; | ||
} | ||
export declare const apollo: <Path extends string = "/graphql">({ path, enablePlayground, context, ...config }: ElysiaApolloConfig<Path, BaseContext>) => Promise<(app: Elysia) => Elysia<"", { | ||
request: {}; | ||
export declare const apollo: <Path extends string = "/graphql">({ path, enablePlayground, context, ...config }: ElysiaApolloConfig<Path, BaseContext>) => Promise<(app: Elysia) => Elysia<"", false, { | ||
decorator: {}; | ||
store: {}; | ||
@@ -62,3 +50,6 @@ derive: {}; | ||
error: {}; | ||
}, {}, {}, { [path in `${Path}`]: { | ||
}, { | ||
schema: {}; | ||
macro: {}; | ||
}, {} & import("elysia/dist/dynamic-handle-rcjNUgOk").af<`${Path}`, { | ||
post: { | ||
@@ -70,3 +61,3 @@ body: { | ||
}; | ||
params: Path extends `${string}/:${string}` | `${string}/*${string}` ? Record<import("elysia/dist/types").GetPathParameter<Path>, string> : never; | ||
params: Record<import("elysia/dist/dynamic-handle-rcjNUgOk").G<Path>, string>; | ||
query: unknown; | ||
@@ -78,18 +69,4 @@ headers: unknown; | ||
}; | ||
}; } extends infer T ? { [K in keyof T]: { [path in `${Path}`]: { | ||
post: { | ||
body: { | ||
operationName?: string | null | undefined; | ||
variables?: {} | undefined; | ||
query: string; | ||
}; | ||
params: Path extends `${string}/:${string}` | `${string}/*${string}` ? Record<import("elysia/dist/types").GetPathParameter<Path>, string> : never; | ||
query: unknown; | ||
headers: unknown; | ||
response: { | ||
200: Promise<Response>; | ||
}; | ||
}; | ||
}; }[K]; } : never, false>>; | ||
}>>>; | ||
export { gql } from 'graphql-tag'; | ||
export default apollo; |
@@ -1,2 +0,1 @@ | ||
/// <reference types="bun-types" /> | ||
import type { Context, Elysia } from 'elysia'; | ||
@@ -12,4 +11,4 @@ import { ApolloServer, BaseContext, type ApolloServerOptions } from '@apollo/server'; | ||
export declare class ElysiaApolloServer<Context extends BaseContext = BaseContext> extends ApolloServer<Context> { | ||
createHandler<Path extends string = '/graphql'>({ path, enablePlayground, context }: ServerRegistration<Path>): Promise<(app: Elysia) => Elysia<"", { | ||
request: {}; | ||
createHandler<Path extends string = '/graphql'>({ path, enablePlayground, context }: ServerRegistration<Path>): Promise<(app: Elysia) => Elysia<"", false, { | ||
decorator: {}; | ||
store: {}; | ||
@@ -21,3 +20,6 @@ derive: {}; | ||
error: {}; | ||
}, {}, {}, { [path in `${Path}`]: { | ||
}, { | ||
schema: {}; | ||
macro: {}; | ||
}, {} & import("elysia/dist/dynamic-handle-rcjNUgOk").af<`${Path}`, { | ||
post: { | ||
@@ -29,3 +31,3 @@ body: { | ||
}; | ||
params: Path extends `${string}/:${string}` | `${string}/*${string}` ? Record<import("elysia/dist/types").GetPathParameter<Path>, string> : never; | ||
params: Record<import("elysia/dist/dynamic-handle-rcjNUgOk").G<Path>, string>; | ||
query: unknown; | ||
@@ -37,20 +39,6 @@ headers: unknown; | ||
}; | ||
}; } extends infer T ? { [K in keyof T]: { [path in `${Path}`]: { | ||
post: { | ||
body: { | ||
operationName?: string | null | undefined; | ||
variables?: {} | undefined; | ||
query: string; | ||
}; | ||
params: Path extends `${string}/:${string}` | `${string}/*${string}` ? Record<import("elysia/dist/types").GetPathParameter<Path>, string> : never; | ||
query: unknown; | ||
headers: unknown; | ||
response: { | ||
200: Promise<Response>; | ||
}; | ||
}; | ||
}; }[K]; } : never, false>>; | ||
}>>>; | ||
} | ||
export declare const apollo: <Path extends string = "/graphql">({ path, enablePlayground, context, ...config }: ElysiaApolloConfig<Path, BaseContext>) => Promise<(app: Elysia) => Elysia<"", { | ||
request: {}; | ||
export declare const apollo: <Path extends string = "/graphql">({ path, enablePlayground, context, ...config }: ElysiaApolloConfig<Path, BaseContext>) => Promise<(app: Elysia) => Elysia<"", false, { | ||
decorator: {}; | ||
store: {}; | ||
@@ -62,3 +50,6 @@ derive: {}; | ||
error: {}; | ||
}, {}, {}, { [path in `${Path}`]: { | ||
}, { | ||
schema: {}; | ||
macro: {}; | ||
}, {} & import("elysia/dist/dynamic-handle-rcjNUgOk").af<`${Path}`, { | ||
post: { | ||
@@ -70,3 +61,3 @@ body: { | ||
}; | ||
params: Path extends `${string}/:${string}` | `${string}/*${string}` ? Record<import("elysia/dist/types").GetPathParameter<Path>, string> : never; | ||
params: Record<import("elysia/dist/dynamic-handle-rcjNUgOk").G<Path>, string>; | ||
query: unknown; | ||
@@ -78,18 +69,4 @@ headers: unknown; | ||
}; | ||
}; } extends infer T ? { [K in keyof T]: { [path in `${Path}`]: { | ||
post: { | ||
body: { | ||
operationName?: string | null | undefined; | ||
variables?: {} | undefined; | ||
query: string; | ||
}; | ||
params: Path extends `${string}/:${string}` | `${string}/*${string}` ? Record<import("elysia/dist/types").GetPathParameter<Path>, string> : never; | ||
query: unknown; | ||
headers: unknown; | ||
response: { | ||
200: Promise<Response>; | ||
}; | ||
}; | ||
}; }[K]; } : never, false>>; | ||
}>>>; | ||
export { gql } from 'graphql-tag'; | ||
export default apollo; |
136
package.json
{ | ||
"name": "@elysiajs/apollo", | ||
"description": "Plugin for Elysia for using GraphQL Apollo", | ||
"version": "0.8.0", | ||
"author": { | ||
"name": "saltyAom", | ||
"url": "https://github.com/SaltyAom", | ||
"email": "saltyaom@gmail.com" | ||
"name": "@elysiajs/apollo", | ||
"description": "Plugin for Elysia for using GraphQL Apollo", | ||
"version": "1.0.0-beta.0", | ||
"author": { | ||
"name": "saltyAom", | ||
"url": "https://github.com/SaltyAom", | ||
"email": "saltyaom@gmail.com" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/elysiajs/elysia-apollo" | ||
}, | ||
"main": "./dist/index.js", | ||
"exports": { | ||
"bun": "./dist/index.js", | ||
"node": "./dist/cjs/index.js", | ||
"require": "./dist/cjs/index.js", | ||
"import": "./dist/index.js", | ||
"default": "./dist/index.js" | ||
}, | ||
"types": "./src/index.ts", | ||
"bugs": "https://github.com/elysiajs/elysia-apollo/issues", | ||
"homepage": "https://github.com/elysiajs/elysia-apollo", | ||
"keywords": [ | ||
"elysia", | ||
"apollo", | ||
"graphql" | ||
], | ||
"license": "MIT", | ||
"scripts": { | ||
"dev": "bun run --hot example/index.ts", | ||
"test": "bun test && npm run test:node", | ||
"test:node": "npm install --prefix ./test/node/cjs/ && npm install --prefix ./test/node/esm/ && node ./test/node/cjs/index.js && node ./test/node/esm/index.js", | ||
"build": "rimraf dist && tsc --project tsconfig.esm.json && tsc --project tsconfig.cjs.json", | ||
"release": "npm run build && npm run test && npm publish --access public" | ||
}, | ||
"dependencies": { | ||
"@apollo/server": "4.7.1", | ||
"@apollo/server-plugin-landing-page-graphql-playground": "^4.0.0", | ||
"@elysiajs/cors": "0.5.0-rc.0", | ||
"graphql": "^16.6.0", | ||
"graphql-tag": "^2.12.6" | ||
}, | ||
"devDependencies": { | ||
"@swc/cli": "^0.1.62", | ||
"@swc/core": "^1.3.58", | ||
"@types/bun": "^1.0.4", | ||
"@types/node": "^20.1.4", | ||
"elysia": "1.0.0-beta.1", | ||
"eslint": "^8.40.0", | ||
"rimraf": "4.3.1", | ||
"typescript": "^5.0.4" | ||
}, | ||
"peerDependencies": { | ||
"elysia": ">= 1.0.0-beta.1" | ||
}, | ||
"peerDependenciesMeta": { | ||
"@apollo/server-plugin-landing-page-graphql-playground": { | ||
"optional": true | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/elysiajs/elysia-apollo" | ||
"@apollo/server": { | ||
"optional": true | ||
}, | ||
"main": "./dist/index.js", | ||
"exports": { | ||
"bun": "./dist/index.js", | ||
"node": "./dist/cjs/index.js", | ||
"require": "./dist/cjs/index.js", | ||
"import": "./dist/index.js", | ||
"default": "./dist/index.js" | ||
"@elysiajs/cors": { | ||
"optional": true | ||
}, | ||
"types": "./src/index.ts", | ||
"bugs": "https://github.com/elysiajs/elysia-apollo/issues", | ||
"homepage": "https://github.com/elysiajs/elysia-apollo", | ||
"keywords": [ | ||
"elysia", | ||
"apollo", | ||
"graphql" | ||
], | ||
"license": "MIT", | ||
"scripts": { | ||
"dev": "bun run --hot example/index.ts", | ||
"test": "bun test && npm run test:node", | ||
"test:node": "npm install --prefix ./test/node/cjs/ && npm install --prefix ./test/node/esm/ && node ./test/node/cjs/index.js && node ./test/node/esm/index.js", | ||
"build": "rimraf dist && tsc --project tsconfig.esm.json && tsc --project tsconfig.cjs.json", | ||
"release": "npm run build && npm run test && npm publish --access public" | ||
"graphql": { | ||
"optional": true | ||
}, | ||
"dependencies": { | ||
"@apollo/server": "4.7.1", | ||
"@apollo/server-plugin-landing-page-graphql-playground": "^4.0.0", | ||
"@elysiajs/cors": "0.5.0-rc.0", | ||
"graphql": "^16.6.0", | ||
"graphql-tag": "^2.12.6" | ||
}, | ||
"devDependencies": { | ||
"@swc/cli": "^0.1.62", | ||
"@swc/core": "^1.3.58", | ||
"@types/node": "^20.1.4", | ||
"bun-types": "^0.5.8", | ||
"elysia": "0.8.0", | ||
"eslint": "^8.40.0", | ||
"rimraf": "4.3.1", | ||
"typescript": "^5.0.4" | ||
}, | ||
"peerDependencies": { | ||
"elysia": ">= 0.8.0" | ||
}, | ||
"peerDependenciesMeta": { | ||
"@apollo/server-plugin-landing-page-graphql-playground": { | ||
"optional": true | ||
}, | ||
"@apollo/server": { | ||
"optional": true | ||
}, | ||
"@elysiajs/cors": { | ||
"optional": true | ||
}, | ||
"graphql": { | ||
"optional": true | ||
}, | ||
"graphql-tag": { | ||
"optional": true | ||
} | ||
"graphql-tag": { | ||
"optional": true | ||
} | ||
} | ||
} |
35133
491