Skip to content

Conversation

@lordnox
Copy link
Collaborator

@lordnox lordnox commented Jul 22, 2019

added createBuild module
connected createBuild module to schemaBuilder
replaced old system

@lordnox lordnox self-assigned this Jul 22, 2019
@lordnox lordnox mentioned this pull request Jul 22, 2019
model: ModelBuilder<Context, any>,
service: Service<Type, GQLType>,
context: Wrapped<Context>,
export const createModel = <BuildMode, Type, GQLType = Type>(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function createModel has 74 lines of code (exceeds 25 allowed). Consider refactoring.

},
) => void

export type AddType<BuildMode, Source, Context> = AddScalarType &

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar blocks of code found in 2 locations. Consider refactoring.


export * from './extension-model'

export const createBuild = <BuildMode = null, Context = any>(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function createBuild has 94 lines of code (exceeds 25 allowed). Consider refactoring.

]

export type AddArgs<BuildMode, Source, Context> =
| AddScalarArgsType

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar blocks of code found in 2 locations. Consider refactoring.

fields: convertGraphQLFieldConfigMap(model.dataFields(dataType)),
})

export const addModel = <BuildMode, Context>(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function addModel has 160 lines of code (exceeds 25 allowed). Consider refactoring.

@qlty-cloud-legacy
Copy link

qlty-cloud-legacy bot commented Jul 22, 2019

Code Climate has analyzed commit 54cc3f7 and detected 27 issues on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 8
Duplication 19

The test coverage on the diff in this pull request is 90.2% (50% is the threshold).

This pull request will bring the total coverage in the repository to 86.4%.

View more on Code Climate.

})

if (visibility.createMutation)
build.addMutation(names.fields.create, modelBuilder.name, {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar blocks of code found in 2 locations. Consider refactoring.

resolver?: Record<string, IFieldResolver<Source, Context>>;
}
]
export type AddInputArgsType<BuildMode, Source, Context> = [

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar blocks of code found in 2 locations. Consider refactoring.

wrapped: Wrapped<BuildMode>,
) => {
const build = baseBuild as WithAddModel<BuildMode, Context>
build.addModel = modelBuilder => {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function addModel has 156 lines of code (exceeds 25 allowed). Consider refactoring.

>

export type AddScalarArgsType = [string, 'scalar', never]
export type AddInterfaceArgsType<BuildMode, Source, Context> = [

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar blocks of code found in 2 locations. Consider refactoring.

export type AddObjectArgsType<BuildMode, Source, Context> = [
string,
'type',
{

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Identical blocks of code found in 2 locations. Consider refactoring.

})

if (visibility.deleteMutation)
build.addMutation(names.fields.delete, list(modelBuilder.name), {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar blocks of code found in 2 locations. Consider refactoring.

[],
).join('\n ')

export const createBuildModeResolver = <BuildMode>(buildMode: BuildMode) => <

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar blocks of code found in 2 locations. Consider refactoring.


import { isBuildModeGenerator } from './guards'

export const createBuildModeResolver = <BuildMode>(buildMode: BuildMode) => <

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar blocks of code found in 2 locations. Consider refactoring.

export type AddObjectType<BuildMode, Source, Context> = (
typeName: string,
type: 'type',
config: {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Identical blocks of code found in 2 locations. Consider refactoring.

),
})

if (visibility.createSubscription)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar blocks of code found in 3 locations. Consider refactoring.

@lordnox lordnox merged commit 367c849 into master Jul 22, 2019
@lordnox lordnox deleted the redesign-to-enable-typedef-output branch July 22, 2019 09:35
@lordnox
Copy link
Collaborator Author

lordnox commented Jul 24, 2019

🎉 This PR is included in version 2.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants