Skip to content
This repository has been archived by the owner on Apr 15, 2020. It is now read-only.

Commit

Permalink
chore(prettier)
Browse files Browse the repository at this point in the history
  • Loading branch information
yaacovCR committed Mar 23, 2020
1 parent 2c4df59 commit fd84e2a
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 20 deletions.
6 changes: 2 additions & 4 deletions src/polyfills/toConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,7 @@ export function toConfig(graphqlObject: any) {
graphqlObject.subscribe != null
) {
return fieldToConfig(graphqlObject);
} else if (
graphqlObject.defaultValue != null
) {
} else if (graphqlObject.defaultValue != null) {
return inputFieldToConfig(graphqlObject);
}

Expand All @@ -153,7 +151,7 @@ export function toConfig(graphqlObject: any) {
const { name, isDeprecated, ...rest } = graphqlObject;
return {
...rest,
}
};
}

throw new Error(`Unknown graphql object ${graphqlObject as string}`);
Expand Down
33 changes: 18 additions & 15 deletions src/test/testAlternateMergeSchemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -680,21 +680,21 @@ describe('rename nested object fields with interfaces', () => {
{
anInnerObject: {
_linkType: 'linkedItem',
aString: 'Hello, world'
}
}
]
aString: 'Hello, world',
},
},
],
};

const transformedNode = {
ALIST: [
{
ANINNEROBJECT: {
_linkType: 'linkedItem',
ASTRING: 'Hello, world'
}
}
]
ASTRING: 'Hello, world',
},
},
],
};

const originalSchema = makeExecutableSchema({
Expand All @@ -718,12 +718,13 @@ describe('rename nested object fields with interfaces', () => {
`,
resolvers: {
_Linkable: {
__resolveType: (linkable: { _linkType: string }) => linkable._linkType
__resolveType: (linkable: { _linkType: string }) =>
linkable._linkType,
},
Query: {
node: () => originalNode,
}
}
},
},
});

const transformedSchema = transformSchema(originalSchema, [
Expand All @@ -735,10 +736,10 @@ describe('rename nested object fields with interfaces', () => {
// Remote uses leading underscores for special fields. Leave them alone.
if (fieldName[0] === '_') {
return fieldName;
};
}

return fieldName.toUpperCase();
})
}),
]);

const originalQuery = `
Expand Down Expand Up @@ -774,8 +775,10 @@ describe('rename nested object fields with interfaces', () => {
const originalResult = graphqlSync(originalSchema, originalQuery);
const transformedResult = graphqlSync(transformedSchema, transformedQuery);

expect(originalResult).to.deep.equal({ data: { node: originalNode }});
expect(transformedResult).to.deep.equal({ data: { node: transformedNode }});
expect(originalResult).to.deep.equal({ data: { node: originalNode } });
expect(transformedResult).to.deep.equal({
data: { node: transformedNode },
});
});
});

Expand Down
3 changes: 2 additions & 1 deletion src/wrap/MapFields.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ function transformDocument(
| undefined = typeInfo.getParentType();
if (parentType != null) {
const parentTypeName = parentType.name;
const fieldNodeTransformers = fieldNodeTransformerMap[parentTypeName];
const fieldNodeTransformers =
fieldNodeTransformerMap[parentTypeName];
let newSelections: Array<SelectionNode> = [];

node.selections.forEach(selection => {
Expand Down

0 comments on commit fd84e2a

Please sign in to comment.