Skip to content

Commit 1277f4f

Browse files
committed
Prettier
1 parent c4e8805 commit 1277f4f

File tree

8 files changed

+21
-23
lines changed

8 files changed

+21
-23
lines changed

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,3 @@ newrelic_agent.log
3030
!.yarn/versions
3131
.mise.toml
3232
docker/supergraph.graphql
33-

e2e/grpc-example/services/movies/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { dirname, join } from 'path';
2+
import { fileURLToPath } from 'url';
23
import { Opts } from '@e2e/opts';
34
import {
45
loadPackageDefinition,
@@ -7,7 +8,6 @@ import {
78
type ServiceClientConstructor,
89
} from '@grpc/grpc-js';
910
import { load } from '@grpc/proto-loader';
10-
import { fileURLToPath } from 'url';
1111

1212
const opts = Opts(process.argv);
1313

@@ -53,7 +53,7 @@ const Movies = [
5353
];
5454

5555
async function startServer(subscriptionInterval = 1000, debug = false): Promise<Server> {
56-
const logger = debug ? (...args) => console.log(...args) : () => { };
56+
const logger = debug ? (...args) => console.log(...args) : () => {};
5757
const server = new Server();
5858

5959
const packageDefinition = await load('./service.proto', {

e2e/top-level-await/mesh.config.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { GraphQLObjectType, GraphQLSchema, GraphQLString } from 'graphql';
2-
import { defineConfig as defineComposeConfig } from '@graphql-mesh/compose-cli';
32
import { defineConfig as defineGatewayConfig } from '@graphql-hive/gateway';
3+
import { defineConfig as defineComposeConfig } from '@graphql-mesh/compose-cli';
44

55
// top level await
66
await Promise.resolve();

packages/loaders/grpc/src/directives.ts

+7-8
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,8 @@ export const GrpcCredentialsSsl = new GraphQLInputObjectType({
9191
privateKey: {
9292
type: GraphQLString,
9393
},
94-
}
95-
})
96-
94+
},
95+
});
9796

9897
export const TransportOptions = new GraphQLInputObjectType({
9998
name: 'TransportOptions',
@@ -109,9 +108,9 @@ export const TransportOptions = new GraphQLInputObjectType({
109108
},
110109
metaData: {
111110
type: ObjMapScalar,
112-
}
113-
}
114-
})
111+
},
112+
},
113+
});
115114

116115
export const transportDirective = new GraphQLDirective({
117116
name: 'transport',
@@ -127,8 +126,8 @@ export const transportDirective = new GraphQLDirective({
127126
},
128127
options: {
129128
type: TransportOptions,
130-
}
129+
},
131130
},
132131
isRepeatable: true,
133132
locations: [DirectiveLocation.SCHEMA],
134-
})
133+
});

packages/loaders/grpc/src/scalars.ts

-1
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,3 @@ export function getGraphQLScalarForGrpc(scalarType: string): string {
2929
}
3030
return SCALARS.get(scalarType);
3131
}
32-

packages/loaders/grpc/src/utils.ts

+7-8
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
1-
import { existsSync } from "fs";
2-
import type { SchemaComposer } from "graphql-compose";
3-
import { isAbsolute, join } from "path";
4-
import type { INamespace, Root } from "protobufjs";
5-
import { getGraphQLScalarForGrpc, isGrpcScalar } from "./scalars.js";
1+
import type { SchemaComposer } from 'graphql-compose';
62
import lodashHas from 'lodash.has';
3+
import type { INamespace, Root } from 'protobufjs';
4+
import { fs, path as pathModule } from '@graphql-mesh/cross-helpers';
5+
import { getGraphQLScalarForGrpc, isGrpcScalar } from './scalars.js';
76

87
export function addIncludePathResolver(root: Root, includePaths: string[]): void {
98
const originalResolvePath = root.resolvePath;
109
root.resolvePath = (origin: string, target: string) => {
11-
if (isAbsolute(target)) {
10+
if (pathModule.isAbsolute(target)) {
1211
return target;
1312
}
1413
for (const directory of includePaths) {
15-
const fullPath: string = join(directory, target);
16-
if (existsSync(fullPath)) {
14+
const fullPath: string = pathModule.join(directory, target);
15+
if (fs.existsSync(fullPath)) {
1716
return fullPath;
1817
}
1918
}

packages/loaders/grpc/test/scalars.spec.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ describe.each<[string, string]>([
2727

2828
describe('Invalid Scalars', () => {
2929
test('getGraphQLScalar should throw an error', () => {
30-
expect(() => getGraphQLScalarForGrpc('randomType')).toThrow(/Could not find GraphQL Scalar for type/);
30+
expect(() => getGraphQLScalarForGrpc('randomType')).toThrow(
31+
/Could not find GraphQL Scalar for type/,
32+
);
3133
});
3234
test('isScalarType should return false for none scalars', () => {
3335
expect(isGrpcScalar('randomType')).toBe(false);

packages/transports/grpc/src/utils.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import type { GraphQLScalarType } from 'graphql';
12
import lodashGet from 'lodash.get';
23
import type { ResolverData } from '@graphql-mesh/string-interpolation';
34
import { stringInterpolator } from '@graphql-mesh/string-interpolation';
@@ -9,7 +10,6 @@ import type {
910
MetadataValue,
1011
} from '@grpc/grpc-js';
1112
import { Metadata } from '@grpc/grpc-js';
12-
import type { GraphQLScalarType } from 'graphql';
1313

1414
function isBlob(input: any): input is Blob {
1515
return input != null && input.stream instanceof Function;

0 commit comments

Comments
 (0)