Skip to content

Commit

Permalink
fix(type): fix connections for different models with the same field n…
Browse files Browse the repository at this point in the history
…ames
  • Loading branch information
Andras Toth committed Dec 18, 2015
1 parent 9a5b8f2 commit 4da2042
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/type/type.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,8 @@ function getTypes(graffitiModels) {
const typeFields = reduce(fields, (typeFields, field, fieldName) => {
if (field.args === connectionArgs) {
// It's a connection
const {connectionType} = connectionDefinitions({name: fieldName, nodeType: types[field.type], connectionFields: {
const fieldNameCapitalized = fieldName.charAt(0).toUpperCase() + fieldName.slice(1);
const {connectionType} = connectionDefinitions({name: `${typeName}${fieldNameCapitalized}`, nodeType: types[field.type], connectionFields: {
count: {
name: 'count',
type: GraphQLFloat
Expand Down

0 comments on commit 4da2042

Please sign in to comment.