@teambit/graphql 1.0.651 → 1.0.652
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,7 @@
|
|
1
1
|
import { Harmony, SlotRegistry } from '@teambit/harmony';
|
2
2
|
import { Logger, LoggerMain } from '@teambit/logger';
|
3
3
|
import { Express } from 'express';
|
4
|
+
import { execute } from 'graphql';
|
4
5
|
import { PubSubEngine } from 'graphql-subscriptions';
|
5
6
|
import { Server } from 'http';
|
6
7
|
import { GraphQLServer } from './graphql-server';
|
@@ -26,6 +27,7 @@ export type GraphQLServerOptions = {
|
|
26
27
|
remoteSchemas?: GraphQLServer[];
|
27
28
|
subscriptionsPortRange?: number[];
|
28
29
|
onWsConnect?: Function;
|
30
|
+
customExecuteFn?: (args: any) => Promise<any>;
|
29
31
|
};
|
30
32
|
export declare class GraphqlMain {
|
31
33
|
/**
|
@@ -76,6 +78,7 @@ export declare class GraphqlMain {
|
|
76
78
|
* returns the schema for a specific aspect by its id.
|
77
79
|
*/
|
78
80
|
getSchema(aspectId: string): Schema | undefined;
|
81
|
+
get execute(): typeof execute;
|
79
82
|
/**
|
80
83
|
* get multiple schema by aspect ids.
|
81
84
|
* used by the cloud.
|
@@ -178,6 +178,9 @@ class GraphqlMain {
|
|
178
178
|
const schema = typeof schemaOrFunc === 'function' ? schemaOrFunc() : schemaOrFunc;
|
179
179
|
return schema;
|
180
180
|
}
|
181
|
+
get execute() {
|
182
|
+
return _graphql().execute;
|
183
|
+
}
|
181
184
|
|
182
185
|
/**
|
183
186
|
* get multiple schema by aspect ids.
|
@@ -217,6 +220,7 @@ class GraphqlMain {
|
|
217
220
|
app.use('/graphql',
|
218
221
|
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
219
222
|
(0, _expressGraphql().graphqlHTTP)((request, res, params) => ({
|
223
|
+
customExecuteFn: options.customExecuteFn,
|
220
224
|
customFormatErrorFn: err => {
|
221
225
|
this.logger.error('graphql got an error during running the following query:', params);
|
222
226
|
this.logger.error('graphql error ', err);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_schema","data","require","_graphqlDisableIntrospection","_interopRequireDefault","_core","_cli","_harmony","_logger","_express","_expressGraphql","_toolboxNetwork","_graphql","_graphqlSubscriptions","_http","_httpProxy","_subscriptionsTransportWs","_cors","_createRemoteSchemas","_graphql2","e","__esModule","default","ownKeys","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","Verb","exports","GraphqlMain","constructor","config","moduleSlot","context","logger","graphQLServerSlot","pubSubSlot","Map","pubsub","pubSubSlots","values","PubSub","getSchema","aspectId","schemaOrFunc","get","undefined","schema","getSchemas","aspectIds","toArray","includes","map","createServer","options","graphiql","disableIntrospection","localSchema","createRootModule","schemaSlot","remoteSchemas","createRemoteSchemas","schemas","concat","x","mergeSchemas","app","express","disableCors","use","cors","origin","callback","credentials","graphqlHTTP","request","res","params","customFormatErrorFn","err","error","assign","ERR_CODE","originalError","errors","name","HTTP_CODE","code","rootValue","validationRules","NoIntrospection","server","subscriptionsPort","subscriptionsPortRange","subscriptionServerPort","getPort","port","createSubscription","proxySubscription","registerServer","register","registerPubSub","Error","listen","serverPort","subServer","info","subscriptionsPath","range","from","to","Port","websocketServer","response","writeHead","end","debug","SubscriptionServer","execute","subscribe","onConnect","onWsConnect","path","proxServer","httpProxy","createProxyServer","on","req","socket","head","url","ws","target","host","modules","buildModules","GraphQLModule","imports","schemaSlots","extensionId","moduleDeps","getModuleDependencies","module","typeDefs","resolvers","schemaDirectives","session","verb","headers","READ","set","extension","extensions","deps","getDependencies","ids","dep","id","Array","entries","depId","provider","loggerFactory","createLogger","GraphqlAspect","graphqlMain","Slot","withType","MainRuntime","LoggerAspect","addRuntime"],"sources":["graphql.main.runtime.ts"],"sourcesContent":["import { mergeSchemas } from '@graphql-tools/schema';\nimport NoIntrospection from 'graphql-disable-introspection';\nimport { GraphQLModule } from '@graphql-modules/core';\nimport { MainRuntime } from '@teambit/cli';\nimport { Harmony, Slot, SlotRegistry } from '@teambit/harmony';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport express, { Express } from 'express';\nimport { graphqlHTTP } from 'express-graphql';\nimport { Port } from '@teambit/toolbox.network.get-port';\nimport { execute, subscribe } from 'graphql';\nimport { PubSubEngine, PubSub } from 'graphql-subscriptions';\nimport { createServer, Server } from 'http';\nimport httpProxy from 'http-proxy';\nimport { SubscriptionServer } from 'subscriptions-transport-ws';\nimport cors from 'cors';\nimport { GraphQLServer } from './graphql-server';\nimport { createRemoteSchemas } from './create-remote-schemas';\nimport { GraphqlAspect } from './graphql.aspect';\nimport { Schema } from './schema';\n\nexport enum Verb {\n WRITE = 'write',\n READ = 'read',\n}\n\nexport type GraphQLConfig = {\n port: number;\n subscriptionsPortRange: number[];\n subscriptionsPath: string;\n disableCors?: boolean;\n};\n\nexport type GraphQLServerSlot = SlotRegistry<GraphQLServer>;\n\nexport type SchemaSlot = SlotRegistry<Schema | (() => Schema)>;\n\nexport type PubSubSlot = SlotRegistry<PubSubEngine>;\n\nexport type GraphQLServerOptions = {\n schemaSlot?: SchemaSlot;\n app?: Express;\n graphiql?: boolean;\n disableIntrospection?: boolean;\n remoteSchemas?: GraphQLServer[];\n subscriptionsPortRange?: number[];\n onWsConnect?: Function;\n};\n\nexport class GraphqlMain {\n constructor(\n /**\n * extension config\n */\n readonly config: GraphQLConfig,\n\n /**\n * slot for registering graphql modules\n */\n private moduleSlot: SchemaSlot,\n\n /**\n * harmony context.\n */\n private context: Harmony,\n\n /**\n * logger extension.\n */\n readonly logger: Logger,\n\n private graphQLServerSlot: GraphQLServerSlot,\n\n /**\n * graphql pubsub. allows to emit events to clients.\n */\n private pubSubSlot: PubSubSlot\n ) {}\n\n get pubsub(): PubSubEngine {\n const pubSubSlots = this.pubSubSlot.values();\n if (pubSubSlots.length) return pubSubSlots[0];\n return new PubSub();\n }\n\n private modules = new Map<string, GraphQLModule>();\n\n /**\n * returns the schema for a specific aspect by its id.\n */\n getSchema(aspectId: string): Schema | undefined {\n const schemaOrFunc = this.moduleSlot.get(aspectId);\n if (!schemaOrFunc) return undefined;\n const schema = typeof schemaOrFunc === 'function' ? schemaOrFunc() : schemaOrFunc;\n return schema;\n }\n\n /**\n * get multiple schema by aspect ids.\n * used by the cloud.\n */\n getSchemas(aspectIds: string[]): Schema[] {\n return this.moduleSlot\n .toArray()\n .filter(([aspectId]) => {\n return aspectIds.includes(aspectId);\n })\n .map(([, schemaOrFunc]) => {\n return typeof schemaOrFunc === 'function' ? schemaOrFunc() : schemaOrFunc;\n });\n }\n\n async createServer(options: GraphQLServerOptions) {\n const { graphiql = true, disableIntrospection } = options;\n const localSchema = this.createRootModule(options.schemaSlot);\n const remoteSchemas = await createRemoteSchemas(options.remoteSchemas || this.graphQLServerSlot.values());\n const schemas = [localSchema.schema].concat(remoteSchemas).filter((x) => x);\n const schema = mergeSchemas({\n schemas,\n });\n\n // TODO: @guy please consider to refactor to express extension.\n const app = options.app || express();\n if (!this.config.disableCors) {\n app.use(\n // @ts-ignore todo: it's not clear what's the issue.\n cors({\n origin(origin, callback) {\n callback(null, true);\n },\n credentials: true,\n })\n );\n }\n\n app.use(\n '/graphql',\n // eslint-disable-next-line @typescript-eslint/no-misused-promises\n graphqlHTTP((request, res, params) => ({\n customFormatErrorFn: (err) => {\n this.logger.error('graphql got an error during running the following query:', params);\n this.logger.error('graphql error ', err);\n return Object.assign(err, {\n // @ts-ignore\n ERR_CODE: err?.originalError?.errors?.[0].ERR_CODE || err.originalError?.constructor?.name,\n // @ts-ignore\n HTTP_CODE: err?.originalError?.errors?.[0].HTTP_CODE || err.originalError?.code,\n });\n },\n schema,\n rootValue: request,\n graphiql,\n validationRules: disableIntrospection ? [NoIntrospection] : undefined,\n }))\n );\n\n const server = createServer(app);\n const subscriptionsPort = options.subscriptionsPortRange || this.config.subscriptionsPortRange;\n const subscriptionServerPort = await this.getPort(subscriptionsPort);\n const { port } = await this.createSubscription(options, subscriptionServerPort);\n this.proxySubscription(server, port);\n\n return server;\n }\n\n /**\n * register a new graphql server.\n */\n registerServer(server: GraphQLServer) {\n this.graphQLServerSlot.register(server);\n return this;\n }\n\n /**\n * register a pubsub client\n */\n registerPubSub(pubsub: PubSubEngine) {\n const pubSubSlots = this.pubSubSlot.toArray();\n if (pubSubSlots.length) throw new Error('can not register more then one pubsub provider');\n this.pubSubSlot.register(pubsub);\n return this;\n }\n\n /**\n * start a graphql server.\n */\n async listen(port?: number, server?: Server, app?: Express) {\n const serverPort = port || this.config.port;\n const subServer = server || (await this.createServer({ app }));\n\n subServer.listen(serverPort, () => {\n this.logger.info(`API Server over HTTP is now running on http://localhost:${serverPort}`);\n this.logger.info(\n `API Server over web socket with subscriptions is now running on ws://localhost:${serverPort}/${this.config.subscriptionsPath}`\n );\n });\n }\n\n /**\n * register a new graphql module.\n * @param schema a function that returns Schema. avoid passing the Schema directly, it's supported only for backward\n * compatibility but really bad for performance. it pulls the entire graphql library.\n */\n register(schema: Schema | (() => Schema)) {\n // const module = new GraphQLModule(schema);\n this.moduleSlot.register(schema);\n return this;\n }\n\n private async getPort(range: number[]) {\n const [from, to] = range;\n return Port.getPort(from, to);\n }\n\n /** create Subscription server with different port */\n\n private async createSubscription(options: GraphQLServerOptions, port: number) {\n // Create WebSocket listener server\n const websocketServer = createServer((request, response) => {\n response.writeHead(404);\n response.end();\n });\n\n // Bind it to port and start listening\n websocketServer.listen(port, () =>\n this.logger.debug(`Websocket Server is now running on http://localhost:${port}`)\n );\n\n const localSchema = this.createRootModule(options.schemaSlot);\n const remoteSchemas = await createRemoteSchemas(options.remoteSchemas || this.graphQLServerSlot.values());\n const schemas = [localSchema.schema].concat(remoteSchemas).filter((x) => x);\n const schema = mergeSchemas({\n schemas,\n });\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const subServer = new SubscriptionServer(\n {\n execute,\n subscribe,\n schema,\n onConnect: options.onWsConnect,\n },\n {\n server: websocketServer,\n path: this.config.subscriptionsPath,\n }\n );\n return { subServer, port };\n }\n /** proxy ws Subscription server to avoid conflict with different websocket connections */\n\n private proxySubscription(server: Server, port: number) {\n const proxServer = httpProxy.createProxyServer();\n const subscriptionsPath = this.config.subscriptionsPath;\n server.on('upgrade', function (req, socket, head) {\n if (req.url === subscriptionsPath) {\n proxServer.ws(req, socket, head, { target: { host: 'localhost', port } });\n }\n });\n }\n\n private createRootModule(schemaSlot?: SchemaSlot) {\n const modules = this.buildModules(schemaSlot);\n\n return new GraphQLModule({\n imports: modules,\n });\n }\n\n private buildModules(schemaSlot?: SchemaSlot) {\n const schemaSlots = schemaSlot ? schemaSlot.toArray() : this.moduleSlot.toArray();\n return schemaSlots.map(([extensionId, schemaOrFunc]) => {\n const schema = typeof schemaOrFunc === 'function' ? schemaOrFunc() : schemaOrFunc;\n const moduleDeps = this.getModuleDependencies(extensionId);\n\n const module = new GraphQLModule({\n typeDefs: schema.typeDefs,\n resolvers: schema.resolvers,\n schemaDirectives: schema.schemaDirectives,\n imports: moduleDeps,\n context: (session) => {\n return {\n ...session,\n verb: session?.headers?.['x-verb'] || Verb.READ,\n };\n },\n });\n\n this.modules.set(extensionId, module);\n\n return module;\n });\n }\n\n private getModuleDependencies(extensionId: string): GraphQLModule[] {\n const extension = this.context.extensions.get(extensionId);\n if (!extension) throw new Error(`aspect ${extensionId} was not found`);\n const deps = this.context.getDependencies(extension);\n const ids = deps.map((dep) => dep.id);\n\n // @ts-ignore check :TODO why types are breaking here.\n return Array.from(this.modules.entries())\n .map(([depId, module]) => {\n const dep = ids.includes(depId);\n if (!dep) return undefined;\n return module;\n })\n .filter((module) => !!module);\n }\n\n static slots = [Slot.withType<Schema>(), Slot.withType<GraphQLServer>(), Slot.withType<PubSubSlot>()];\n\n static defaultConfig = {\n port: 4000,\n subscriptionsPortRange: [2000, 2100],\n disableCors: false,\n subscriptionsPath: '/subscriptions',\n };\n\n static runtime = MainRuntime;\n static dependencies = [LoggerAspect];\n\n static async provider(\n [loggerFactory]: [LoggerMain],\n config: GraphQLConfig,\n [moduleSlot, graphQLServerSlot, pubSubSlot]: [SchemaSlot, GraphQLServerSlot, PubSubSlot],\n context: Harmony\n ) {\n const logger = loggerFactory.createLogger(GraphqlAspect.id);\n const graphqlMain = new GraphqlMain(config, moduleSlot, context, logger, graphQLServerSlot, pubSubSlot);\n graphqlMain.registerPubSub(new PubSub());\n return graphqlMain;\n }\n}\n\nGraphqlAspect.addRuntime(GraphqlMain);\n"],"mappings":";;;;;;AAAA,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,6BAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,4BAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,MAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,KAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,KAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,IAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,SAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,QAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAO,QAAA;EAAA,MAAAP,IAAA,GAAAC,OAAA;EAAAM,OAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAQ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AI,EAAE,IAAI,CAAC;EACpCzB,WAAW,EAAE,KAAK;EAClBuC,iBAAiB,EAAE;AACrB,CAAC;AAAAhG,eAAA,CA7QUkB,WAAW,aA+QL2I,kBAAW;AAAA7J,eAAA,CA/QjBkB,WAAW,kBAgRA,CAAC4I,sBAAY,CAAC;AAetCL,yBAAa,CAACM,UAAU,CAAC7I,WAAW,CAAC","ignoreList":[]}
|
1
|
+
{"version":3,"names":["_schema","data","require","_graphqlDisableIntrospection","_interopRequireDefault","_core","_cli","_harmony","_logger","_express","_expressGraphql","_toolboxNetwork","_graphql","_graphqlSubscriptions","_http","_httpProxy","_subscriptionsTransportWs","_cors","_createRemoteSchemas","_graphql2","e","__esModule","default","ownKeys","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","Verb","exports","GraphqlMain","constructor","config","moduleSlot","context","logger","graphQLServerSlot","pubSubSlot","Map","pubsub","pubSubSlots","values","PubSub","getSchema","aspectId","schemaOrFunc","get","undefined","schema","execute","getSchemas","aspectIds","toArray","includes","map","createServer","options","graphiql","disableIntrospection","localSchema","createRootModule","schemaSlot","remoteSchemas","createRemoteSchemas","schemas","concat","x","mergeSchemas","app","express","disableCors","use","cors","origin","callback","credentials","graphqlHTTP","request","res","params","customExecuteFn","customFormatErrorFn","err","error","assign","ERR_CODE","originalError","errors","name","HTTP_CODE","code","rootValue","validationRules","NoIntrospection","server","subscriptionsPort","subscriptionsPortRange","subscriptionServerPort","getPort","port","createSubscription","proxySubscription","registerServer","register","registerPubSub","Error","listen","serverPort","subServer","info","subscriptionsPath","range","from","to","Port","websocketServer","response","writeHead","end","debug","SubscriptionServer","subscribe","onConnect","onWsConnect","path","proxServer","httpProxy","createProxyServer","on","req","socket","head","url","ws","target","host","modules","buildModules","GraphQLModule","imports","schemaSlots","extensionId","moduleDeps","getModuleDependencies","module","typeDefs","resolvers","schemaDirectives","session","verb","headers","READ","set","extension","extensions","deps","getDependencies","ids","dep","id","Array","entries","depId","provider","loggerFactory","createLogger","GraphqlAspect","graphqlMain","Slot","withType","MainRuntime","LoggerAspect","addRuntime"],"sources":["graphql.main.runtime.ts"],"sourcesContent":["import { mergeSchemas } from '@graphql-tools/schema';\nimport NoIntrospection from 'graphql-disable-introspection';\nimport { GraphQLModule } from '@graphql-modules/core';\nimport { MainRuntime } from '@teambit/cli';\nimport { Harmony, Slot, SlotRegistry } from '@teambit/harmony';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport express, { Express } from 'express';\nimport { graphqlHTTP } from 'express-graphql';\nimport { Port } from '@teambit/toolbox.network.get-port';\nimport { execute, subscribe } from 'graphql';\nimport { PubSubEngine, PubSub } from 'graphql-subscriptions';\nimport { createServer, Server } from 'http';\nimport httpProxy from 'http-proxy';\nimport { SubscriptionServer } from 'subscriptions-transport-ws';\nimport cors from 'cors';\nimport { GraphQLServer } from './graphql-server';\nimport { createRemoteSchemas } from './create-remote-schemas';\nimport { GraphqlAspect } from './graphql.aspect';\nimport { Schema } from './schema';\n\nexport enum Verb {\n WRITE = 'write',\n READ = 'read',\n}\n\nexport type GraphQLConfig = {\n port: number;\n subscriptionsPortRange: number[];\n subscriptionsPath: string;\n disableCors?: boolean;\n};\n\nexport type GraphQLServerSlot = SlotRegistry<GraphQLServer>;\n\nexport type SchemaSlot = SlotRegistry<Schema | (() => Schema)>;\n\nexport type PubSubSlot = SlotRegistry<PubSubEngine>;\n\nexport type GraphQLServerOptions = {\n schemaSlot?: SchemaSlot;\n app?: Express;\n graphiql?: boolean;\n disableIntrospection?: boolean;\n remoteSchemas?: GraphQLServer[];\n subscriptionsPortRange?: number[];\n onWsConnect?: Function;\n customExecuteFn?: (args: any) => Promise<any>;\n};\n\nexport class GraphqlMain {\n constructor(\n /**\n * extension config\n */\n readonly config: GraphQLConfig,\n\n /**\n * slot for registering graphql modules\n */\n private moduleSlot: SchemaSlot,\n\n /**\n * harmony context.\n */\n private context: Harmony,\n\n /**\n * logger extension.\n */\n readonly logger: Logger,\n\n private graphQLServerSlot: GraphQLServerSlot,\n\n /**\n * graphql pubsub. allows to emit events to clients.\n */\n private pubSubSlot: PubSubSlot\n ) {}\n\n get pubsub(): PubSubEngine {\n const pubSubSlots = this.pubSubSlot.values();\n if (pubSubSlots.length) return pubSubSlots[0];\n return new PubSub();\n }\n\n private modules = new Map<string, GraphQLModule>();\n\n /**\n * returns the schema for a specific aspect by its id.\n */\n getSchema(aspectId: string): Schema | undefined {\n const schemaOrFunc = this.moduleSlot.get(aspectId);\n if (!schemaOrFunc) return undefined;\n const schema = typeof schemaOrFunc === 'function' ? schemaOrFunc() : schemaOrFunc;\n return schema;\n }\n\n get execute() {\n return execute;\n }\n\n /**\n * get multiple schema by aspect ids.\n * used by the cloud.\n */\n getSchemas(aspectIds: string[]): Schema[] {\n return this.moduleSlot\n .toArray()\n .filter(([aspectId]) => {\n return aspectIds.includes(aspectId);\n })\n .map(([, schemaOrFunc]) => {\n return typeof schemaOrFunc === 'function' ? schemaOrFunc() : schemaOrFunc;\n });\n }\n\n async createServer(options: GraphQLServerOptions) {\n const { graphiql = true, disableIntrospection } = options;\n const localSchema = this.createRootModule(options.schemaSlot);\n const remoteSchemas = await createRemoteSchemas(options.remoteSchemas || this.graphQLServerSlot.values());\n const schemas = [localSchema.schema].concat(remoteSchemas).filter((x) => x);\n const schema = mergeSchemas({\n schemas,\n });\n\n // TODO: @guy please consider to refactor to express extension.\n const app = options.app || express();\n if (!this.config.disableCors) {\n app.use(\n // @ts-ignore todo: it's not clear what's the issue.\n cors({\n origin(origin, callback) {\n callback(null, true);\n },\n credentials: true,\n })\n );\n }\n\n app.use(\n '/graphql',\n // eslint-disable-next-line @typescript-eslint/no-misused-promises\n graphqlHTTP((request, res, params) => ({\n customExecuteFn: options.customExecuteFn,\n customFormatErrorFn: (err) => {\n this.logger.error('graphql got an error during running the following query:', params);\n this.logger.error('graphql error ', err);\n return Object.assign(err, {\n // @ts-ignore\n ERR_CODE: err?.originalError?.errors?.[0].ERR_CODE || err.originalError?.constructor?.name,\n // @ts-ignore\n HTTP_CODE: err?.originalError?.errors?.[0].HTTP_CODE || err.originalError?.code,\n });\n },\n schema,\n rootValue: request,\n graphiql,\n validationRules: disableIntrospection ? [NoIntrospection] : undefined,\n }))\n );\n\n const server = createServer(app);\n const subscriptionsPort = options.subscriptionsPortRange || this.config.subscriptionsPortRange;\n const subscriptionServerPort = await this.getPort(subscriptionsPort);\n const { port } = await this.createSubscription(options, subscriptionServerPort);\n this.proxySubscription(server, port);\n\n return server;\n }\n\n /**\n * register a new graphql server.\n */\n registerServer(server: GraphQLServer) {\n this.graphQLServerSlot.register(server);\n return this;\n }\n\n /**\n * register a pubsub client\n */\n registerPubSub(pubsub: PubSubEngine) {\n const pubSubSlots = this.pubSubSlot.toArray();\n if (pubSubSlots.length) throw new Error('can not register more then one pubsub provider');\n this.pubSubSlot.register(pubsub);\n return this;\n }\n\n /**\n * start a graphql server.\n */\n async listen(port?: number, server?: Server, app?: Express) {\n const serverPort = port || this.config.port;\n const subServer = server || (await this.createServer({ app }));\n\n subServer.listen(serverPort, () => {\n this.logger.info(`API Server over HTTP is now running on http://localhost:${serverPort}`);\n this.logger.info(\n `API Server over web socket with subscriptions is now running on ws://localhost:${serverPort}/${this.config.subscriptionsPath}`\n );\n });\n }\n\n /**\n * register a new graphql module.\n * @param schema a function that returns Schema. avoid passing the Schema directly, it's supported only for backward\n * compatibility but really bad for performance. it pulls the entire graphql library.\n */\n register(schema: Schema | (() => Schema)) {\n // const module = new GraphQLModule(schema);\n this.moduleSlot.register(schema);\n return this;\n }\n\n private async getPort(range: number[]) {\n const [from, to] = range;\n return Port.getPort(from, to);\n }\n\n /** create Subscription server with different port */\n\n private async createSubscription(options: GraphQLServerOptions, port: number) {\n // Create WebSocket listener server\n const websocketServer = createServer((request, response) => {\n response.writeHead(404);\n response.end();\n });\n\n // Bind it to port and start listening\n websocketServer.listen(port, () =>\n this.logger.debug(`Websocket Server is now running on http://localhost:${port}`)\n );\n\n const localSchema = this.createRootModule(options.schemaSlot);\n const remoteSchemas = await createRemoteSchemas(options.remoteSchemas || this.graphQLServerSlot.values());\n const schemas = [localSchema.schema].concat(remoteSchemas).filter((x) => x);\n const schema = mergeSchemas({\n schemas,\n });\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const subServer = new SubscriptionServer(\n {\n execute,\n subscribe,\n schema,\n onConnect: options.onWsConnect,\n },\n {\n server: websocketServer,\n path: this.config.subscriptionsPath,\n }\n );\n return { subServer, port };\n }\n /** proxy ws Subscription server to avoid conflict with different websocket connections */\n\n private proxySubscription(server: Server, port: number) {\n const proxServer = httpProxy.createProxyServer();\n const subscriptionsPath = this.config.subscriptionsPath;\n server.on('upgrade', function (req, socket, head) {\n if (req.url === subscriptionsPath) {\n proxServer.ws(req, socket, head, { target: { host: 'localhost', port } });\n }\n });\n }\n\n private createRootModule(schemaSlot?: SchemaSlot) {\n const modules = this.buildModules(schemaSlot);\n\n return new GraphQLModule({\n imports: modules,\n });\n }\n\n private buildModules(schemaSlot?: SchemaSlot) {\n const schemaSlots = schemaSlot ? schemaSlot.toArray() : this.moduleSlot.toArray();\n return schemaSlots.map(([extensionId, schemaOrFunc]) => {\n const schema = typeof schemaOrFunc === 'function' ? schemaOrFunc() : schemaOrFunc;\n const moduleDeps = this.getModuleDependencies(extensionId);\n\n const module = new GraphQLModule({\n typeDefs: schema.typeDefs,\n resolvers: schema.resolvers,\n schemaDirectives: schema.schemaDirectives,\n imports: moduleDeps,\n context: (session) => {\n return {\n ...session,\n verb: session?.headers?.['x-verb'] || Verb.READ,\n };\n },\n });\n\n this.modules.set(extensionId, module);\n\n return module;\n });\n }\n\n private getModuleDependencies(extensionId: string): GraphQLModule[] {\n const extension = this.context.extensions.get(extensionId);\n if (!extension) throw new Error(`aspect ${extensionId} was not found`);\n const deps = this.context.getDependencies(extension);\n const ids = deps.map((dep) => dep.id);\n\n // @ts-ignore check :TODO why types are breaking here.\n return Array.from(this.modules.entries())\n .map(([depId, module]) => {\n const dep = ids.includes(depId);\n if (!dep) return undefined;\n return module;\n })\n .filter((module) => !!module);\n }\n\n static slots = [Slot.withType<Schema>(), Slot.withType<GraphQLServer>(), Slot.withType<PubSubSlot>()];\n\n static defaultConfig = {\n port: 4000,\n subscriptionsPortRange: [2000, 2100],\n disableCors: false,\n subscriptionsPath: '/subscriptions',\n };\n\n static runtime = MainRuntime;\n static dependencies = [LoggerAspect];\n\n static async provider(\n [loggerFactory]: [LoggerMain],\n config: GraphQLConfig,\n [moduleSlot, graphQLServerSlot, pubSubSlot]: [SchemaSlot, GraphQLServerSlot, PubSubSlot],\n context: Harmony\n ) {\n const logger = loggerFactory.createLogger(GraphqlAspect.id);\n const graphqlMain = new GraphqlMain(config, moduleSlot, context, logger, graphQLServerSlot, pubSubSlot);\n graphqlMain.registerPubSub(new PubSub());\n return graphqlMain;\n }\n}\n\nGraphqlAspect.addRuntime(GraphqlMain);\n"],"mappings":";;;;;;AAAA,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,6BAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,4BAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,MAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,KAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,KAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,IAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA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CAAC/D,cAAc,CAAC,KAAI9D,8BAAM,EAAC,CAAC,CAAC;IACxC,OAAO6H,WAAW;EACpB;AACF;AAAC1I,OAAA,CAAAC,WAAA,GAAAA,WAAA;AAAAlB,eAAA,CAlSYkB,WAAW,WA2QP,CAAC0I,eAAI,CAACC,QAAQ,CAAS,CAAC,EAAED,eAAI,CAACC,QAAQ,CAAgB,CAAC,EAAED,eAAI,CAACC,QAAQ,CAAa,CAAC,CAAC;AAAA7J,eAAA,CA3Q1FkB,WAAW,mBA6QC;EACrBqE,IAAI,EAAE,IAAI;EACVH,sBAAsB,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC;EACpC1B,WAAW,EAAE,KAAK;EAClBwC,iBAAiB,EAAE;AACrB,CAAC;AAAAlG,eAAA,CAlRUkB,WAAW,aAoRL4I,kBAAW;AAAA9J,eAAA,CApRjBkB,WAAW,kBAqRA,CAAC6I,sBAAY,CAAC;AAetCL,yBAAa,CAACM,UAAU,CAAC9I,WAAW,CAAC","ignoreList":[]}
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.harmony_graphql@1.0.
|
2
|
-
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.harmony_graphql@1.0.
|
1
|
+
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.harmony_graphql@1.0.652/dist/graphql.composition.js';
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.harmony_graphql@1.0.652/dist/graphql.docs.mdx';
|
3
3
|
|
4
4
|
export const compositions = [compositions_0];
|
5
5
|
export const overview = [overview_0];
|
package/package.json
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
{
|
2
2
|
"name": "@teambit/graphql",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.652",
|
4
4
|
"homepage": "https://bit.cloud/teambit/harmony/graphql",
|
5
5
|
"main": "dist/index.js",
|
6
6
|
"componentId": {
|
7
7
|
"scope": "teambit.harmony",
|
8
8
|
"name": "graphql",
|
9
|
-
"version": "1.0.
|
9
|
+
"version": "1.0.652"
|
10
10
|
},
|
11
11
|
"dependencies": {
|
12
12
|
"@graphql-modules/core": "0.7.17",
|
@@ -32,10 +32,10 @@
|
|
32
32
|
"bufferutil": "4.0.3",
|
33
33
|
"@teambit/harmony": "0.4.7",
|
34
34
|
"@teambit/ui-foundation.ui.is-browser": "0.0.500",
|
35
|
-
"@teambit/cli": "0.0.
|
36
|
-
"@teambit/logger": "0.0.
|
35
|
+
"@teambit/cli": "0.0.1229",
|
36
|
+
"@teambit/logger": "0.0.1322",
|
37
37
|
"@teambit/toolbox.network.get-port": "1.0.10",
|
38
|
-
"@teambit/ui": "1.0.
|
38
|
+
"@teambit/ui": "1.0.652"
|
39
39
|
},
|
40
40
|
"devDependencies": {
|
41
41
|
"@types/cors": "2.8.10",
|
@@ -46,9 +46,9 @@
|
|
46
46
|
"@types/mocha": "9.1.0",
|
47
47
|
"@teambit/harmony.envs.core-aspect-env": "0.0.69",
|
48
48
|
"@teambit/harmony.testing.load-aspect": "0.0.314",
|
49
|
-
"@teambit/lanes": "1.0.
|
49
|
+
"@teambit/lanes": "1.0.653",
|
50
50
|
"@teambit/workspace.testing.mock-workspace": "0.0.94",
|
51
|
-
"@teambit/workspace": "1.0.
|
51
|
+
"@teambit/workspace": "1.0.652"
|
52
52
|
},
|
53
53
|
"peerDependencies": {
|
54
54
|
"@apollo/client": "^3.6.0",
|