Skip to content

Commit 0f08703

Browse files
committed
Update dependencies
Signed-off-by: Alan Cha <[email protected]>
1 parent d05cab8 commit 0f08703

File tree

8 files changed

+15327
-3011
lines changed

8 files changed

+15327
-3011
lines changed

packages/openapi-to-graphql-cli/package-lock.json

Lines changed: 3623 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/openapi-to-graphql-cli/package.json

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
"tslint-config-standard": "^9.0.0"
6262
},
6363
"bin": {
64-
"openapi-to-graphql": "./dist/openapi-to-graphql.js"
64+
"openapi-to-graphql": "./dist/index.js"
6565
},
6666
"sideEffects": false,
6767
"main": "dist/index.js",
@@ -80,11 +80,8 @@
8080
"import": "./dist/*.mjs"
8181
}
8282
},
83-
"buildOptions": {
84-
"bin": {
85-
"openapi-to-graphql": {
86-
"input": "src/index.ts"
87-
}
88-
}
83+
"scripts": {
84+
"dev": "tsc -w",
85+
"build": "tsc --project ../../tsconfig.build.json"
8986
}
9087
}

packages/openapi-to-graphql-cli/src/index.ts

Lines changed: 16 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -92,43 +92,6 @@ program
9292
)
9393
.parse(process.argv)
9494

95-
// Select the port on which to host the GraphQL server
96-
const portNumber: number = program.port ? program.port : 3000
97-
98-
/**
99-
* Assemble headers so that they are in the proper format for the
100-
* OpenAPI-to-GraphQL library
101-
*/
102-
const headers: { [key: string]: string } = parseKeyValuePairs(program.header)
103-
const qs: { [key: string]: string } = parseKeyValuePairs(program.queryString)
104-
105-
const options: Options<any, any, any> = {
106-
strict: program.strict,
107-
108-
// Resolver options
109-
baseUrl: program.url,
110-
111-
// Schema options
112-
operationIdFieldNames: program.operationIdFieldNames,
113-
fillEmptyResponses: program.fillEmptyResponses,
114-
addLimitArgument: program.addLimitArgument,
115-
genericPayloadArgName: program.genericPayloadArgName,
116-
simpleNames: program.simpleNames,
117-
simpleEnumValues: program.simpleEnumValues,
118-
singularNames: program.singularNames,
119-
120-
// Resolver options
121-
headers,
122-
qs,
123-
124-
// Authentication options
125-
viewer: program.viewer,
126-
127-
// Logging options
128-
provideErrorExtensions: program.extensions,
129-
equivalentToMessages: program.equivalentToMessages
130-
}
131-
13295
const filePaths: string[] = program.args
13396

13497
if (typeof filePaths === 'undefined' || filePaths.length === 0) {
@@ -169,6 +132,22 @@ Promise.all(
169132
})
170133
)
171134
.then((oass) => {
135+
// Select the port on which to host the GraphQL server
136+
const portNumber: number = program.port ? program.port : 3000
137+
138+
const options: Options<any, any, any> = {
139+
...program.opts(),
140+
141+
/**
142+
* Assemble headers and query strings so that they are in the proper format
143+
* for the OpenAPI-to-GraphQL library
144+
*/
145+
...{
146+
headers: parseKeyValuePairs(program.header),
147+
qs: parseKeyValuePairs(program.queryString)
148+
}
149+
}
150+
172151
startGraphQLServer(oass, options, portNumber)
173152
})
174153
.catch((error) => {

0 commit comments

Comments
 (0)