Skip to content

Redesign to enable typedef output - #81

Merged
lordnox merged 32 commits into
masterfrom
redesign-to-enable-typedef-output
Jul 22, 2019
Merged

Redesign to enable typedef output#81
lordnox merged 32 commits into
masterfrom
redesign-to-enable-typedef-output

Conversation

@lordnox

Copy link
Copy Markdown
Collaborator

added createBuild module
connected createBuild module to schemaBuilder
replaced old system

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

Copy link
Copy Markdown

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 &

Copy link
Copy Markdown

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>(

Copy link
Copy Markdown

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

Copy link
Copy Markdown

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>(

Copy link
Copy Markdown

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

qlty-cloud-legacyBot commented Jul 22, 2019

Copy link
Copy Markdown

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

Here's the issue category breakdown:

CategoryCount
Complexity8
Duplication19

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, {

Copy link
Copy Markdown

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> = [

Copy link
Copy Markdown

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 => {

Copy link
Copy Markdown

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> = [

Copy link
Copy Markdown

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',
{

Copy link
Copy Markdown

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), {

Copy link
Copy Markdown

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) => <

Copy link
Copy Markdown

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) => <

Copy link
Copy Markdown

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: {

Copy link
Copy Markdown

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)

Copy link
Copy Markdown

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 masterJul 22, 2019
@lordnox
lordnox deleted the redesign-to-enable-typedef-output branch July 22, 2019 09:35
@lordnox

Copy link
Copy Markdown
CollaboratorAuthor

🎉 This PR is included in version 2.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for freeto 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.

1 participant

@lordnox