-
Notifications
You must be signed in to change notification settings - Fork 311
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: no circular module graph (#1301)
- Loading branch information
1 parent
6417878
commit 55a24bc
Showing
17 changed files
with
580 additions
and
1,590 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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
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,10 +1,11 @@ | ||
import { type ConfigInit, updateContext } from '../Configuration/ConfigInit.js' | ||
import { Context } from '../../types/context.js' | ||
import { type ConfigInit } from '../Configuration/ConfigInit.js' | ||
import { createProperties } from '../helpers.js' | ||
|
||
export const withProperties = createProperties((builder, state) => { | ||
return { | ||
with: (configInit: ConfigInit) => { | ||
return builder(updateContext(state, configInit)) | ||
return builder(Context.updateContextConfigInit(state, configInit)) | ||
}, | ||
} as any | ||
}) |
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
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
export const standardScalarTypeNames = { | ||
String: `String`, | ||
ID: `ID`, | ||
Int: `Int`, | ||
Float: `Float`, | ||
Boolean: `Boolean`, | ||
} | ||
|
||
export interface StandardScalarRuntimeTypeMap { | ||
String: string | ||
ID: string | ||
Int: number | ||
Float: number | ||
Boolean: boolean | ||
} | ||
|
||
export type StandardScalarRuntimeTypes = StandardScalarRuntimeTypeMap[keyof StandardScalarRuntimeTypeMap] |
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import type { GraphQLInputObjectType } from 'graphql' | ||
import { type GraphQLField, type GraphQLScalarType, isNonNullType, isScalarType } from 'graphql' | ||
import { standardScalarTypeNames } from './scalars.js' | ||
import type { InputFieldLikeTypes } from './schema.js' | ||
|
||
export const isScalarTypeCustom = (node: GraphQLScalarType): boolean => { | ||
return !(node.name in standardScalarTypeNames) | ||
} | ||
|
||
export const isScalarTypeAndCustom = (node: unknown): node is GraphQLScalarType => { | ||
return isScalarType(node) && isScalarTypeCustom(node) | ||
} | ||
|
||
export const isAllInputObjectFieldsNullable = (node: GraphQLInputObjectType) => { | ||
return Object.values(node.getFields()).some(_ => !isNonNullType(_.type)) | ||
} | ||
|
||
export const isInputFieldLike = (value: object): value is InputFieldLikeTypes => { | ||
return `defaultValue` in value | ||
} | ||
|
||
export const isField = (value: object): value is GraphQLField<any, any> | InputFieldLikeTypes => { | ||
return isOutputField(value) || isInputFieldLike(value) | ||
} | ||
|
||
export const isOutputField = (value: object): value is GraphQLField<any, any> => { | ||
return `args` in value | ||
} |
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