Skip to content

Commit 919818d

Browse files
committed
Change some comments
Signed-off-by: Alan Cha <[email protected]>
1 parent 3be1a02 commit 919818d

File tree

7 files changed

+11
-11
lines changed

7 files changed

+11
-11
lines changed

packages/openapi-to-graphql/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ Resolver options:
178178

179179
- `customResolvers` (type: `object`, default: `{}`): OpenAPI-to-GraphQL, by default, creates resolver functions that make REST calls to resolve fields in the generated GraphQL interface. This option allows users to provide custom resolver functions to be used in place of said ones created by OpenAPI-to-GraphQL. The field that the custom resolver will affect is identifed first by the [title](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#infoObject) of the OAS, then the [path](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#paths-object) of the operation, and lastly the [method](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#path-item-object) of the operation. The `customResolvers` object is thus a triply nested object where the outer key is the title, followed by the path, and finally the method, which points to the [resolver function](https://graphql.org/learn/execution/#root-fields-resolvers) itself. The resolver function can use the parameters `obj`, `args`, `context`, and `info` in order to produce the proper data, as do standard [resolver functions](https://graphql.org/learn/execution/#root-fields-resolvers) in GraphQL. Use cases include the resolution of complex relationships between types, implementing performance improvements like caching, or dealing with non-standard authentication requirements. _Note: Because the arguments are provided by the GraphQL interface, they may look different from the [parameters](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#parameterObject) defined by the OAS. For example, they will have [sanitized](https://github.com/Alan-Cha/openapi-to-graphql#characteristics) names. The [request body](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#requestBodyObject) will also be contained in the arguments as an [input object type](https://graphql.org/graphql-js/mutations-and-input-types/)._
180180

181-
- `createSubscriptionsFromCallbacks` (type: `boolean`, default: `false`): Generates subscription fields from [callback objects](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#CallbackObject). The keys ([runtime expressions](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#runtimeExpression)) of the callback objects will be interpolated as the topic of a publish/subscription connection using [graphql-subscriptions](https://github.com/apollographql/graphql-subscriptions). Read the [doc](./docs/SUBSCRIPTIONS.md) for explanations and examples regarding its usage.
181+
- `createSubscriptionsFromCallbacks` (type: `boolean`, default: `false`): Generates subscription fields from [callback objects](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#CallbackObject). The keys ([runtime expressions](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#runtimeExpression)) of the callback objects will be interpolated as the topic of a publish/subscription connection using [graphql-subscriptions](https://github.com/apollographql/graphql-subscriptions). Read the [doc](./docs/subscriptions.md) for explanations and examples regarding its usage.
182182

183183
***
184184

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ declare type GetSubscribeParams = {
2727
export declare function getSubscribe({ operation, payloadName, data, baseUrl, connectOptions }: GetSubscribeParams): SubscriptionIterator;
2828
export declare function getPublishResolver({ operation, argsFromLink, responseName, data }: GetResolverParams): ResolveFunction;
2929
/**
30-
* if operationType is Query | Mutation, creates and returns a resolver function that performs API requests for the
30+
* If operationType is Query/Mutation, creates and returns a resolver function that performs API requests for the
3131
* given GraphQL query
3232
*/
3333
export declare function getResolver({ operation, argsFromLink, payloadName, data, baseUrl, requestOptions }: GetResolverParams): ResolveFunction;

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

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/types/options.d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,8 @@ export declare type Options = {
132132
*/
133133
baseUrl?: string;
134134
/**
135-
* Allows to define custom resolvers for fields on the query/mutation/subscription root
136-
* operation type.
135+
* Allows to define custom resolvers for fields on the Query/Mutation |
136+
* Subscription root operation type.
137137
*
138138
* In other words, instead of resolving on an operation (REST call) defined in
139139
* the OAS, the field will resolve on the custom resolver. Note that this will
@@ -310,8 +310,8 @@ export declare type InternalOptions = {
310310
*/
311311
baseUrl?: string;
312312
/**
313-
* Allows to define custom resolvers for fields on the query/mutation/subscription
314-
* root operation type.
313+
* Allows to define custom resolvers for fields on the Query/Mutation |
314+
* Subscription root operation type.
315315
*
316316
* In other words, instead of resolving on an operation (REST call) defined in
317317
* the OAS, the field will resolve on the custom resolver. Note that this will

packages/openapi-to-graphql/src/resolver_builder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ export function getPublishResolver({
285285
}
286286

287287
/**
288-
* if operationType is Query | Mutation, creates and returns a resolver function that performs API requests for the
288+
* If operationType is Query/Mutation, creates and returns a resolver function that performs API requests for the
289289
* given GraphQL query
290290
*/
291291
export function getResolver({

packages/openapi-to-graphql/src/types/options.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,8 @@ export type Options = {
156156
baseUrl?: string
157157

158158
/**
159-
* Allows to define custom resolvers for fields on the query/mutation/subscription root
160-
* operation type.
159+
* Allows to define custom resolvers for fields on the Query/Mutation/Subscription
160+
* root operation type.
161161
*
162162
* In other words, instead of resolving on an operation (REST call) defined in
163163
* the OAS, the field will resolve on the custom resolver. Note that this will
@@ -358,7 +358,7 @@ export type InternalOptions = {
358358
baseUrl?: string
359359

360360
/**
361-
* Allows to define custom resolvers for fields on the query/mutation/subscription
361+
* Allows to define custom resolvers for fields on the Query/Mutation/Subscription
362362
* root operation type.
363363
*
364364
* In other words, instead of resolving on an operation (REST call) defined in

0 commit comments

Comments
 (0)