Skip to content

Commit

Permalink
chore(deps): update dependency prettier to v1.18.2 (apollographql/apo…
Browse files Browse the repository at this point in the history
…llo-server#2807)

* chore(deps): update dependency prettier to v1.18.2

* New Prettier opinionatedness.

Apollo-Orig-Commit-AS: apollographql/apollo-server@42ab6b8
  • Loading branch information
renovate[bot] authored and abernix committed Jun 25, 2019
1 parent 608139d commit dcd301d
Show file tree
Hide file tree
Showing 13 changed files with 19 additions and 57 deletions.
2 changes: 1 addition & 1 deletion federation-js/src/composition/normalize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export function defaultRootOperationTypes(
): DocumentNode {
// Map of OperationTypeNode to its respective default root operation type name
const defaultRootOperationNameLookup: {
[node in OperationTypeNode]: DefaultRootOperationTypeName
[node in OperationTypeNode]: DefaultRootOperationTypeName;
} = {
query: 'Query',
mutation: 'Mutation',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@ export const externalMissingOnBase = (schema: GraphQLSchema) => {
errorWithCode(
'EXTERNAL_MISSING_ON_BASE',
logServiceAndType(serviceName, typeName, externalFieldName) +
`marked @external but ${externalFieldName} is not defined on the base service of ${typeName} (${
namedType.federation.serviceName
})`,
`marked @external but ${externalFieldName} is not defined on the base service of ${typeName} (${namedType.federation.serviceName})`,
),
);
continue;
Expand All @@ -51,11 +49,7 @@ export const externalMissingOnBase = (schema: GraphQLSchema) => {
errorWithCode(
'EXTERNAL_MISSING_ON_BASE',
logServiceAndType(serviceName, typeName, externalFieldName) +
`marked @external but ${externalFieldName} was defined in ${
matchingBaseField.federation.serviceName
}, not in the service that owns ${typeName} (${
namedType.federation.serviceName
})`,
`marked @external but ${externalFieldName} was defined in ${matchingBaseField.federation.serviceName}, not in the service that owns ${typeName} (${namedType.federation.serviceName})`,
),
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,7 @@ export const externalTypeMismatch = (schema: GraphQLSchema) => {
errorWithCode(
'EXTERNAL_TYPE_MISMATCH',
logServiceAndType(serviceName, typeName, externalFieldName) +
`Type \`${
externalFieldType.name
}\` does not match the type of the original field in ${
namedType.federation.serviceName
} (\`${matchingBaseField.type}\`)`,
`Type \`${externalFieldType.name}\` does not match the type of the original field in ${namedType.federation.serviceName} (\`${matchingBaseField.type}\`)`,
),
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@ export const keyFieldsMissingOnBase = (schema: GraphQLSchema) => {
errorWithCode(
'KEY_FIELDS_MISSING_ON_BASE',
logServiceAndType(serviceName, typeName) +
`A @key selects ${name}, but ${typeName}.${name} was either created or overwritten by ${
matchingField.federation.serviceName
}, not ${serviceName}`,
`A @key selects ${name}, but ${typeName}.${name} was either created or overwritten by ${matchingField.federation.serviceName}, not ${serviceName}`,
),
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,7 @@ export const providesFieldsMissingExternal = (schema: GraphQLSchema) => {
errorWithCode(
'PROVIDES_FIELDS_MISSING_EXTERNAL',
logServiceAndType(serviceName, typeName, fieldName) +
`provides the field \`${
selection.name.value
}\` and requires ${typeName}.${
selection.name.value
} to be marked as @external.`,
`provides the field \`${selection.name.value}\` and requires ${typeName}.${selection.name.value} to be marked as @external.`,
),
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@ export const providesNotOnEntity = (schema: GraphQLSchema) => {
errorWithCode(
'PROVIDES_NOT_ON_ENTITY',
logServiceAndType(serviceName, typeName, fieldName) +
`uses the @provides directive but \`${typeName}.${fieldName}\` returns \`${
field.type
}\`, which is not an Object type. @provides can only be used on Object types with at least one @key.`,
`uses the @provides directive but \`${typeName}.${fieldName}\` returns \`${field.type}\`, which is not an Object type. @provides can only be used on Object types with at least one @key.`,
),
);
continue;
Expand All @@ -48,9 +46,7 @@ export const providesNotOnEntity = (schema: GraphQLSchema) => {
errorWithCode(
'PROVIDES_NOT_ON_ENTITY',
logServiceAndType(serviceName, typeName, fieldName) +
`uses the @provides directive but \`${typeName}.${fieldName}\` does not return a type that has a @key. Try adding a @key to the \`${
field.type
}\` type.`,
`uses the @provides directive but \`${typeName}.${fieldName}\` does not return a type that has a @key. Try adding a @key to the \`${field.type}\` type.`,
),
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,7 @@ export const requiresFieldsMissingExternal = (schema: GraphQLSchema) => {
errorWithCode(
'REQUIRES_FIELDS_MISSING_EXTERNAL',
logServiceAndType(serviceName, typeName, fieldName) +
`requires the field \`${
selection.name.value
}\` to be marked as @external.`,
`requires the field \`${selection.name.value}\` to be marked as @external.`,
),
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,7 @@ export const requiresFieldsMissingOnBase = (schema: GraphQLSchema) => {
errorWithCode(
'REQUIRES_FIELDS_MISSING_ON_BASE',
logServiceAndType(serviceName, typeName, fieldName) +
`requires the field \`${
selection.name.value
}\` to be @external. @external fields must exist on the base type, not an extension.`,
`requires the field \`${selection.name.value}\` to be @external. @external fields must exist on the base type, not an extension.`,
),
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,7 @@ export const keyFieldsMissingExternal = ({
errorWithCode(
'KEY_FIELDS_MISSING_EXTERNAL',
logServiceAndType(serviceName, parentType.name) +
`A @key directive specifies the \`${
fieldDef.name
}\` field which has no matching @external field.`,
`A @key directive specifies the \`${fieldDef.name}\` field which has no matching @external field.`,
),
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const rootFieldUsed = ({

// Map of OperationTypeNode to its respective default root operation type name
const defaultRootOperationNameLookup: {
[node in OperationTypeNode]: DefaultRootOperationTypeName
[node in OperationTypeNode]: DefaultRootOperationTypeName;
} = {
query: 'Query',
mutation: 'Mutation',
Expand All @@ -35,7 +35,7 @@ export const rootFieldUsed = ({
);

const disallowedTypeNames: {
[key in DefaultRootOperationTypeName]?: boolean
[key in DefaultRootOperationTypeName]?: boolean;
} = {};

let hasSchemaDefinitionOrExtension = false;
Expand Down
16 changes: 4 additions & 12 deletions gateway-js/src/buildQueryPlan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,7 @@ function splitRootFields(

if (!owningService) {
throw new GraphQLError(
`Couldn't find owning service for field "${parentType.name}.${
fieldDef.name
}"`,
`Couldn't find owning service for field "${parentType.name}.${fieldDef.name}"`,
fieldNode,
);
}
Expand Down Expand Up @@ -233,9 +231,7 @@ function splitRootFieldsSerially(

if (!owningService) {
throw new GraphQLError(
`Couldn't find owning service for field "${parentType.name}.${
fieldDef.name
}"`,
`Couldn't find owning service for field "${parentType.name}.${fieldDef.name}"`,
fieldNode,
);
}
Expand Down Expand Up @@ -268,9 +264,7 @@ function splitSubfields(

if (!owningService) {
throw new GraphQLError(
`Couldn't find owning service for field "${parentType.name}.${
fieldDef.name
}"`,
`Couldn't find owning service for field "${parentType.name}.${fieldDef.name}"`,
fieldNode,
);
}
Expand Down Expand Up @@ -314,9 +308,7 @@ function splitSubfields(

if (!keyFields) {
throw new GraphQLError(
`Couldn't find keys for type "${
parentType.name
}}" in service "${baseService}"`,
`Couldn't find keys for type "${parentType.name}}" in service "${baseService}"`,
fieldNode,
);
}
Expand Down
4 changes: 1 addition & 3 deletions gateway-js/src/executeQueryPlan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,7 @@ async function executeFetch<TContext>(

if (receivedEntities.length !== representations.length) {
throw new Error(
`Expected "data._entities" to contain ${
representations.length
} elements`,
`Expected "data._entities" to contain ${representations.length} elements`,
);
}

Expand Down
4 changes: 1 addition & 3 deletions gateway-js/src/loadServicesFromRemoteEndpoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,7 @@ export async function getServiceDefinitionsFromRemoteEndpoint({
})
.catch(error => {
console.warn(
`Encountered error when loading ${service.name} at ${
service.url
}: ${error.message}`,
`Encountered error when loading ${service.name} at ${service.url}: ${error.message}`,
);
return false;
});
Expand Down

0 comments on commit dcd301d

Please sign in to comment.