Skip to content

Commit 6fb64c7

Browse files
committed
Support for oneOf and union types
Related to #197 Signed-off-by: Alan Cha <[email protected]>
1 parent 19ee48a commit 6fb64c7

28 files changed

+534
-166
lines changed

packages/openapi-to-graphql/lib/index.d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
*
44
* Some general notes:
55
*
6-
* - GraphQL interfaces rely on sanitized strings for (Input) Object Type names
6+
* - GraphQL interfaces rely on sanitized strings for (input) object type names
77
* and fields. We perform sanitization only when assigning (field-) names, but
88
* keep keys in the OAS otherwise as-is, to ensure that inner-OAS references
99
* work as expected.
1010
*
11-
* - GraphQL (Input) Object Types must have a unique name. Thus, sometimes Input
12-
* Object Types and Object Types need separate names, despite them having the
13-
* same structure. We thus append 'Input' to every Input Object Type's name
11+
* - GraphQL (input) object types must have a unique name. Thus, sometimes Input
12+
* object types and object types need separate names, despite them having the
13+
* same structure. We thus append 'Input' to every input object type's name
1414
* as a convention.
1515
*
1616
* - To pass data between resolve functions, OpenAPI-to-GraphQL uses a _openapiToGraphql object

packages/openapi-to-graphql/lib/index.js

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

packages/openapi-to-graphql/lib/oas_3_tools.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import { Oas3, ServerObject, ParameterObject, SchemaObject, OperationObject, Res
77
import { PreprocessingData, ProcessedSecurityScheme } from './types/preprocessing_data';
88
import { InternalOptions } from './types/options';
99
export declare type SchemaNames = {
10-
fromPath?: string;
11-
fromSchema?: string;
1210
fromRef?: string;
11+
fromSchema?: string;
12+
fromPath?: string;
1313
/**
1414
* Used when the preferred name is known, i.e. a new data def does not need to
1515
* be created

packages/openapi-to-graphql/lib/oas_3_tools.js

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

packages/openapi-to-graphql/lib/oas_3_tools.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/openapi-to-graphql/lib/preprocessor.d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ export declare function preprocessOas(oass: Oas3[], options: InternalOptions): P
1111
/**
1212
* Method to either create a new or reuse an existing, centrally stored data
1313
* definition. Data definitions are objects that hold a schema (= JSON schema),
14-
* an otName (= String to use as the name for Object Types), and an iotName
15-
* (= String to use as the name for Input Object Types). Eventually, data
16-
* definitions also hold an ot (= the Object Type for the schema) and an iot
17-
* (= the Input Object Type for the schema).
14+
* an otName (= String to use as the name for object types), and an iotName
15+
* (= String to use as the name for input object types). Eventually, data
16+
* definitions also hold an ot (= the object type for the schema) and an iot
17+
* (= the input object type for the schema).
1818
*
1919
* Either names or preferredName should exist.
2020
*/

packages/openapi-to-graphql/lib/preprocessor.js

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

0 commit comments

Comments
 (0)