-
Notifications
You must be signed in to change notification settings - Fork 139
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: multiple small federation related fixes, also dealing with multi…
…ple capital letters in names (#726)
- Loading branch information
Showing
8 changed files
with
32 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import { GraphQLResolveInfo } from 'graphql' | ||
import { GqlContext, {{#if hasArguments}}Mutation{{toUpperCase mutationName}}Args{{/if}} } from "{{generatedPrefix}}/graphql/types"; | ||
import { GqlContext, {{#if hasArguments}}{{pascalCasedArgName}}{{/if}} } from "{{generatedPrefix}}/graphql/types"; | ||
import { {{mutationName}}Mutation } from "{{appPrefix}}/{{graphqlFileRootPath}}mutations/{{mutationName}}Mutation"; | ||
|
||
export const test{{toUpperCase mutationName}} = ({{#if hasArguments}}variables: Mutation{{toUpperCase mutationName}}Args, {{/if}}context: GqlContext) => {{mutationName}}Mutation?.({}, {{#if hasArguments}}variables{{else}} {} {{/if}}, context, {} as GraphQLResolveInfo) | ||
export const test{{toUpperCase mutationName}} = ({{#if hasArguments}}variables: {{pascalCasedArgName}}, {{/if}}context: GqlContext) => {{mutationName}}Mutation?.({}, {{#if hasArguments}}variables{{else}} {} {{/if}}, context, {} as GraphQLResolveInfo) | ||
|
||
export type {GqlContext, {{#if hasArguments}}Mutation{{toUpperCase mutationName}}Args{{/if}} } | ||
export type {GqlContext, {{#if hasArguments}}{{pascalCasedArgName}}{{/if}} } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
import { GraphQLResolveInfo } from 'graphql' | ||
import { GqlContext, {{#if hasArguments}}Query{{toUpperCase queryName}}Args{{/if}} } from "{{generatedPrefix}}/graphql/types"; | ||
import { GqlContext, {{#if hasArguments}}{{pascalCasedArgName}}{{/if}} } from "{{generatedPrefix}}/graphql/types"; | ||
import { {{queryName}}Query } from "{{appPrefix}}/{{graphqlFileRootPath}}queries/{{queryName}}Query"; | ||
|
||
|
||
export const test{{toUpperCase queryName}} = ({{#if hasArguments}}variables: Query{{toUpperCase queryName}}Args,{{/if}} context: GqlContext) => {{queryName}}Query?.({}, {{#if hasArguments}}variables{{else}} {} {{/if}}, context, {} as GraphQLResolveInfo) | ||
export const test{{toUpperCase queryName}} = ({{#if hasArguments}}variables: {{pascalCasedArgName}},{{/if}} context: GqlContext) => {{queryName}}Query?.({}, {{#if hasArguments}}variables{{else}} {} {{/if}}, context, {} as GraphQLResolveInfo) | ||
|
||
|
||
export type {GqlContext, {{#if hasArguments}}Query{{toUpperCase queryName}}Args{{/if}} } | ||
export type {GqlContext, {{#if hasArguments}}{{pascalCasedArgName}}{{/if}} } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
import { GraphQLResolveInfo } from 'graphql' | ||
import type { GqlContext, ResolversParentTypes, {{#if hasArguments}}{{typeName}}{{capitalizedFieldName}}Args{{/if}} } from "{{generatedPrefix}}/graphql/types"; | ||
import type { GqlContext, ResolversParentTypes, {{#if hasArguments}}{{pascalCasedArgName}}{{/if}} } from "{{generatedPrefix}}/graphql/types"; | ||
import { {{typeName}}{{capitalizedFieldName}} } from "{{appPrefix}}/{{graphqlFileRootPath}}types/{{typeName}}{{capitalizedFieldName}}"; | ||
|
||
{{#if resolveReferenceType}}type ParentType = Parameters<typeof {{typeName}}{{capitalizedFieldName}}>[0];{{/if}} | ||
{{#if resolveReferenceType}}type ParentType = Parameters<NonNullable<typeof {{typeName}}{{capitalizedFieldName}}>>[0];{{else}} | ||
type ParentType = ResolversParentTypes["{{typeName}}"] | ||
{{/if}} | ||
|
||
export const test{{typeName}}{{capitalizedFieldName}} = (parent: {{#if resolveReferenceType}}ParentType{{else}}ResolversParentTypes["{{typeName}}"]{{/if}}, {{#if hasArguments}}variables: {{typeName}}{{capitalizedFieldName}}Args,{{/if}} context: GqlContext) => {{typeName}}{{capitalizedFieldName}}?.({...parent, __typename: '{{typeName}}'}, {{#unless resolveReferenceType}}{{#if hasArguments}}variables{{else}} {} {{/if}},{{/unless}} context, {} as GraphQLResolveInfo) | ||
export const test{{typeName}}{{capitalizedFieldName}} = (parent: ParentType, {{#if hasArguments}}variables: {{pascalCasedArgName}},{{/if}} context: GqlContext) => {{typeName}}{{capitalizedFieldName}}?.({...parent, {{#if isFederatedAndExternal}}__typename: '{{typeName}}'{{/if}} }, {{#unless resolveReferenceType}}{{#if hasArguments}}variables{{else}} {} {{/if}},{{/unless}} context, {} as GraphQLResolveInfo) | ||
|
||
export type {GqlContext, ResolversParentTypes {{#if hasArguments}},{{typeName}}{{capitalizedFieldName}}Args{{/if}} } | ||
export type {GqlContext, ParentType, ResolversParentTypes {{#if hasArguments}},{{pascalCasedArgName}}{{/if}} } |