Skip to content

#406 added extend type XXX {} support - #408

Merged
bbakerman merged 4 commits into
graphql-java:masterfrom
bbakerman:406-extend-type-support-in-idl
May 7, 2017
Merged

bbakerman merged 4 commits into
graphql-java:masterfrom
bbakerman:406-extend-type-support-in-idl

Conversation

@bbakerman

@bbakerman bbakerman commented May 5, 2017 •

Copy link
Copy Markdown
Member

#406 added extend type XXX {} support

this now allows the type extension syntax

        type BaseType {
            fieldA : Int
        }

        extend type BaseType {
            fieldB : Int
        }

This could be in multiple files say to modularize the schema files.

The schema grammar always had these...we just didnt apply them in the generator

I think this should be in 3.x because it fits the "add IDL support" them in 3.x

@bbakerman bbakerman added this to the 3.0.0 milestone May 5, 2017

@andimarek andimarek left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Great work ... just some minor clean code issues.

}));

// combine all the fields together
for (GraphQLFieldDefinition fieldDefinition : fieldDefinitions.values()) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

maybe also a forEach here to be consistent?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

done


typeDefinition.getFieldDefinitions().forEach(fieldDef ->
builder.field(buildField(buildCtx, typeDefinition, fieldDef)));
//

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This whole Method buildObjectType is too long imho. I suggest splitting it up into smaller parts.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

done

}

//
// interfaces

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't think such comments are very helpful: If you wanna document the following block I suggest extracting a method and name the method appropriately.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

done

bbakerman added 2 commits May 7, 2017 16:19
…upport-in-idl

# Conflicts:
#	src/main/java/graphql/schema/idl/SchemaGenerator.java
#	src/test/groovy/readme/README.next.md
@bbakerman
bbakerman merged commit a62601f into graphql-java:master May 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants