@graphql-mesh/mysql 0.94.4 → 0.94.5-alpha-20230713134914-3bdc4dfa1
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.
- package/cjs/index.js +12 -0
- package/esm/index.js +13 -1
- package/package.json +4 -4
package/cjs/index.js
CHANGED
|
@@ -124,6 +124,9 @@ class MySQLHandler {
|
|
|
124
124
|
async getMeshSource() {
|
|
125
125
|
const { pool: configPool } = this.config;
|
|
126
126
|
const schemaComposer = new graphql_compose_1.SchemaComposer();
|
|
127
|
+
const rejectUnauthorized = typeof this.config.ssl?.rejectUnauthorized === 'undefined'
|
|
128
|
+
? true
|
|
129
|
+
: this.config.ssl.rejectUnauthorized;
|
|
127
130
|
const pool = configPool
|
|
128
131
|
? typeof configPool === 'string'
|
|
129
132
|
? await (0, utils_1.loadFromModuleExportExpression)(configPool, {
|
|
@@ -137,6 +140,8 @@ class MySQLHandler {
|
|
|
137
140
|
bigNumberStrings: true,
|
|
138
141
|
trace: !!cross_helpers_1.process.env.DEBUG,
|
|
139
142
|
debug: !!cross_helpers_1.process.env.DEBUG,
|
|
143
|
+
localAddress: this.config.localAddress &&
|
|
144
|
+
string_interpolation_1.stringInterpolator.parse(this.config.localAddress, { env: cross_helpers_1.process.env }),
|
|
140
145
|
host: this.config.host && string_interpolation_1.stringInterpolator.parse(this.config.host, { env: cross_helpers_1.process.env }),
|
|
141
146
|
port: this.config.port &&
|
|
142
147
|
parseInt(string_interpolation_1.stringInterpolator.parse(this.config.port.toString(), { env: cross_helpers_1.process.env })),
|
|
@@ -145,6 +150,13 @@ class MySQLHandler {
|
|
|
145
150
|
string_interpolation_1.stringInterpolator.parse(this.config.password, { env: cross_helpers_1.process.env }),
|
|
146
151
|
database: this.config.database &&
|
|
147
152
|
string_interpolation_1.stringInterpolator.parse(this.config.database, { env: cross_helpers_1.process.env }),
|
|
153
|
+
ssl: {
|
|
154
|
+
rejectUnauthorized,
|
|
155
|
+
ca: this.config.ssl?.ca &&
|
|
156
|
+
(await cross_helpers_1.fs.promises.readFile(cross_helpers_1.path.isAbsolute(this.config.ssl.ca)
|
|
157
|
+
? cross_helpers_1.path.join(this.baseDir, this.config.ssl.ca)
|
|
158
|
+
: this.config.ssl.ca)),
|
|
159
|
+
},
|
|
148
160
|
...this.config,
|
|
149
161
|
});
|
|
150
162
|
pool.on('connection', connection => {
|
package/esm/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import graphqlFields from 'graphql-fields';
|
|
|
4
4
|
import { GraphQLBigInt, GraphQLDate, GraphQLDateTime, GraphQLJSON, GraphQLTime, GraphQLTimestamp, GraphQLUnsignedFloat, GraphQLUnsignedInt, } from 'graphql-scalars';
|
|
5
5
|
import { createPool } from 'mysql';
|
|
6
6
|
import { introspection, upgrade } from 'mysql-utilities';
|
|
7
|
-
import { process, util } from '@graphql-mesh/cross-helpers';
|
|
7
|
+
import { fs, path, process, util } from '@graphql-mesh/cross-helpers';
|
|
8
8
|
import { PredefinedProxyOptions } from '@graphql-mesh/store';
|
|
9
9
|
import { stringInterpolator } from '@graphql-mesh/string-interpolation';
|
|
10
10
|
import { loadFromModuleExportExpression, sanitizeNameForGraphQL } from '@graphql-mesh/utils';
|
|
@@ -121,6 +121,9 @@ export default class MySQLHandler {
|
|
|
121
121
|
async getMeshSource() {
|
|
122
122
|
const { pool: configPool } = this.config;
|
|
123
123
|
const schemaComposer = new SchemaComposer();
|
|
124
|
+
const rejectUnauthorized = typeof this.config.ssl?.rejectUnauthorized === 'undefined'
|
|
125
|
+
? true
|
|
126
|
+
: this.config.ssl.rejectUnauthorized;
|
|
124
127
|
const pool = configPool
|
|
125
128
|
? typeof configPool === 'string'
|
|
126
129
|
? await loadFromModuleExportExpression(configPool, {
|
|
@@ -134,6 +137,8 @@ export default class MySQLHandler {
|
|
|
134
137
|
bigNumberStrings: true,
|
|
135
138
|
trace: !!process.env.DEBUG,
|
|
136
139
|
debug: !!process.env.DEBUG,
|
|
140
|
+
localAddress: this.config.localAddress &&
|
|
141
|
+
stringInterpolator.parse(this.config.localAddress, { env: process.env }),
|
|
137
142
|
host: this.config.host && stringInterpolator.parse(this.config.host, { env: process.env }),
|
|
138
143
|
port: this.config.port &&
|
|
139
144
|
parseInt(stringInterpolator.parse(this.config.port.toString(), { env: process.env })),
|
|
@@ -142,6 +147,13 @@ export default class MySQLHandler {
|
|
|
142
147
|
stringInterpolator.parse(this.config.password, { env: process.env }),
|
|
143
148
|
database: this.config.database &&
|
|
144
149
|
stringInterpolator.parse(this.config.database, { env: process.env }),
|
|
150
|
+
ssl: {
|
|
151
|
+
rejectUnauthorized,
|
|
152
|
+
ca: this.config.ssl?.ca &&
|
|
153
|
+
(await fs.promises.readFile(path.isAbsolute(this.config.ssl.ca)
|
|
154
|
+
? path.join(this.baseDir, this.config.ssl.ca)
|
|
155
|
+
: this.config.ssl.ca)),
|
|
156
|
+
},
|
|
145
157
|
...this.config,
|
|
146
158
|
});
|
|
147
159
|
pool.on('connection', connection => {
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-mesh/mysql",
|
|
3
|
-
"version": "0.94.
|
|
3
|
+
"version": "0.94.5-alpha-20230713134914-3bdc4dfa1",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"peerDependencies": {
|
|
6
6
|
"@graphql-mesh/cross-helpers": "^0.4.0",
|
|
7
|
-
"@graphql-mesh/store": "
|
|
8
|
-
"@graphql-mesh/types": "
|
|
9
|
-
"@graphql-mesh/utils": "
|
|
7
|
+
"@graphql-mesh/store": "0.94.4-alpha-20230713134914-3bdc4dfa1",
|
|
8
|
+
"@graphql-mesh/types": "0.94.4-alpha-20230713134914-3bdc4dfa1",
|
|
9
|
+
"@graphql-mesh/utils": "0.94.4-alpha-20230713134914-3bdc4dfa1",
|
|
10
10
|
"@graphql-tools/utils": "^9.2.1 || ^10.0.0",
|
|
11
11
|
"graphql": "*",
|
|
12
12
|
"tslib": "^2.4.0"
|