Add prettierrc, add it to linter and force it to do it
This commit is contained in:
Родитель
47d7f0c6ed
Коммит
7b56b0050c
|
@ -9,5 +9,10 @@
|
|||
"es6": true,
|
||||
"node": true
|
||||
},
|
||||
"ignorePatterns": ["**/coverage", "**/lib", "**/temp"]
|
||||
"ignorePatterns": ["**/coverage", "**/lib", "**/temp"],
|
||||
"plugins": ["prettier"],
|
||||
"rules": {
|
||||
"prettier/prettier": "error"
|
||||
},
|
||||
"extends": ["plugin:prettier/recommended"]
|
||||
}
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"trailingComma": "all"
|
||||
}
|
|
@ -36,7 +36,7 @@ beforeAll(() => {
|
|||
testRenderer = createTestRenderer(
|
||||
<ApolloProvider client={client}>
|
||||
<FeedbackApp />
|
||||
</ApolloProvider>
|
||||
</ApolloProvider>,
|
||||
);
|
||||
});
|
||||
});
|
||||
|
@ -89,8 +89,8 @@ it("resolves a query", async () => {
|
|||
// Resolve the query operation and await the promise
|
||||
await act(() =>
|
||||
client.mock.resolveMostRecentOperation((operation) =>
|
||||
MockPayloadGenerator.generate(operation)
|
||||
)
|
||||
MockPayloadGenerator.generate(operation),
|
||||
),
|
||||
);
|
||||
|
||||
expect(() => {
|
||||
|
@ -102,7 +102,7 @@ it("rejects a query", async () => {
|
|||
await act(() => client.mock.rejectMostRecentOperation(new Error("Uh-oh")));
|
||||
|
||||
const errorMessage = testRenderer.root.find(
|
||||
(node) => node.props.id === "error"
|
||||
(node) => node.props.id === "error",
|
||||
);
|
||||
expect(errorMessage.props.children).toBe("Uh-oh");
|
||||
});
|
||||
|
@ -158,7 +158,7 @@ const FeedbackComponent: React.FC = (props) => {
|
|||
```tsx
|
||||
it("resolves a mutation", async () => {
|
||||
const likeButton = testRenderer.root.find(
|
||||
(node) => node.props.id === "likeButton"
|
||||
(node) => node.props.id === "likeButton",
|
||||
);
|
||||
await act(async () => {
|
||||
likeButton.props.onClick();
|
||||
|
@ -174,8 +174,8 @@ it("resolves a mutation", async () => {
|
|||
doesViewerLike: true,
|
||||
};
|
||||
},
|
||||
})
|
||||
)
|
||||
}),
|
||||
),
|
||||
);
|
||||
|
||||
expect(likeButton.props.children).toEqual("Unlike");
|
||||
|
@ -183,7 +183,7 @@ it("resolves a mutation", async () => {
|
|||
|
||||
it("rejects a mutation", async () => {
|
||||
const likeButton = testRenderer.root.find(
|
||||
(node) => node.props.id === "likeButton"
|
||||
(node) => node.props.id === "likeButton",
|
||||
);
|
||||
await act(async () => {
|
||||
likeButton.props.onClick();
|
||||
|
@ -228,13 +228,13 @@ const FeedbackComponent: React.FC = (props) => {
|
|||
```tsx
|
||||
it("resolves a subscription", async () => {
|
||||
const reaction = testRenderer.root.find(
|
||||
(node) => node.props.id === "reaction"
|
||||
(node) => node.props.id === "reaction",
|
||||
);
|
||||
expect(reaction.props.children).toBe("Viewer does not like it");
|
||||
|
||||
const operation = client.mock.getMostRecentOperation();
|
||||
expect(getOperationName(operation.request.node)).toBe(
|
||||
"FeedbackLikeSubscription"
|
||||
"FeedbackLikeSubscription",
|
||||
);
|
||||
expect(operation.request.variables).toEqual({
|
||||
input: {
|
||||
|
@ -252,8 +252,8 @@ it("resolves a subscription", async () => {
|
|||
doesViewerLike: true,
|
||||
};
|
||||
},
|
||||
})
|
||||
)
|
||||
}),
|
||||
),
|
||||
);
|
||||
expect(reaction.props.children).toBe("Viewer likes it");
|
||||
});
|
||||
|
|
|
@ -26,8 +26,8 @@ import { ApolloMockClient, createMockClient } from "../index";
|
|||
const schema = buildSchema(
|
||||
readFileSync(
|
||||
require.resolve("relay-test-utils-internal/lib/testschema.graphql"),
|
||||
"utf8"
|
||||
)
|
||||
"utf8",
|
||||
),
|
||||
);
|
||||
|
||||
describe("ReactRelayTestMocker with Containers", () => {
|
||||
|
@ -66,7 +66,7 @@ describe("ReactRelayTestMocker with Containers", () => {
|
|||
testComponentTree = ReactTestRenderer.create(
|
||||
<ApolloProvider client={client}>
|
||||
<TestComponent />
|
||||
</ApolloProvider>
|
||||
</ApolloProvider>,
|
||||
);
|
||||
});
|
||||
});
|
||||
|
@ -78,7 +78,7 @@ describe("ReactRelayTestMocker with Containers", () => {
|
|||
it("should return most recent operation", () => {
|
||||
const operation = client.mock.getMostRecentOperation();
|
||||
expect(getOperationName(operation.request.node)).toBe(
|
||||
"RelayMockEnvironmentWithComponentsTestFantasticEffortQuery"
|
||||
"RelayMockEnvironmentWithComponentsTestFantasticEffortQuery",
|
||||
);
|
||||
expect(operation.request.variables).toEqual({
|
||||
id: "<default>",
|
||||
|
@ -94,8 +94,8 @@ describe("ReactRelayTestMocker with Containers", () => {
|
|||
await ReactTestRenderer.act(() =>
|
||||
// Make sure request was issued
|
||||
client.mock.resolveMostRecentOperation((operation) =>
|
||||
MockPayloadGenerator.generate(operation)
|
||||
)
|
||||
MockPayloadGenerator.generate(operation),
|
||||
),
|
||||
);
|
||||
|
||||
// Should render some data
|
||||
|
@ -104,11 +104,11 @@ describe("ReactRelayTestMocker with Containers", () => {
|
|||
|
||||
it("should reject query", async () => {
|
||||
await ReactTestRenderer.act(() =>
|
||||
client.mock.rejectMostRecentOperation(new Error("Uh-oh"))
|
||||
client.mock.rejectMostRecentOperation(new Error("Uh-oh")),
|
||||
);
|
||||
|
||||
const errorMessage = testComponentTree.root.find(
|
||||
(node) => node.props.id === "error"
|
||||
(node) => node.props.id === "error",
|
||||
);
|
||||
// Should render error
|
||||
expect(errorMessage.props.children).toBe("Uh-oh");
|
||||
|
@ -118,16 +118,16 @@ describe("ReactRelayTestMocker with Containers", () => {
|
|||
await ReactTestRenderer.act(() =>
|
||||
client.mock.rejectMostRecentOperation(
|
||||
(operation) =>
|
||||
new Error(`Uh-oh: ${getOperationName(operation.request.node)}`)
|
||||
)
|
||||
new Error(`Uh-oh: ${getOperationName(operation.request.node)}`),
|
||||
),
|
||||
);
|
||||
|
||||
const errorMessage = testComponentTree.root.find(
|
||||
(node) => node.props.id === "error"
|
||||
(node) => node.props.id === "error",
|
||||
);
|
||||
// Should render error
|
||||
expect(errorMessage.props.children).toBe(
|
||||
"Uh-oh: RelayMockEnvironmentWithComponentsTestFantasticEffortQuery"
|
||||
"Uh-oh: RelayMockEnvironmentWithComponentsTestFantasticEffortQuery",
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -186,7 +186,7 @@ describe("ReactRelayTestMocker with Containers", () => {
|
|||
}) {
|
||||
const [busy, setBusy] = React.useState(false);
|
||||
const [errorMessage, setErrorMessage] = React.useState<string | null>(
|
||||
null
|
||||
null,
|
||||
);
|
||||
const [like] = useMutation(FeedbackLikeMutation, {
|
||||
onCompleted: () => {
|
||||
|
@ -252,7 +252,7 @@ describe("ReactRelayTestMocker with Containers", () => {
|
|||
testComponentTree = ReactTestRenderer.create(
|
||||
<ApolloProvider client={client}>
|
||||
<TestComponent />
|
||||
</ApolloProvider>
|
||||
</ApolloProvider>,
|
||||
);
|
||||
});
|
||||
await ReactTestRenderer.act(() =>
|
||||
|
@ -266,19 +266,19 @@ describe("ReactRelayTestMocker with Containers", () => {
|
|||
doesViewerLike: false,
|
||||
};
|
||||
},
|
||||
})
|
||||
)
|
||||
}),
|
||||
),
|
||||
);
|
||||
});
|
||||
|
||||
it("should resolve mutation", async () => {
|
||||
const likeButton = testComponentTree.root.find(
|
||||
(node) => node.props.id === "likeButton"
|
||||
(node) => node.props.id === "likeButton",
|
||||
);
|
||||
expect(likeButton.props.disabled).toBe(false);
|
||||
expect(likeButton.props.children).toEqual("Like");
|
||||
expect(testComponentTree).toMatchSnapshot(
|
||||
'Button should be enabled. Text should be "Like".'
|
||||
'Button should be enabled. Text should be "Like".',
|
||||
);
|
||||
|
||||
// Should apply optimistic updates
|
||||
|
@ -289,7 +289,7 @@ describe("ReactRelayTestMocker with Containers", () => {
|
|||
expect(likeButton.props.disabled).toBe(true);
|
||||
expect(likeButton.props.children).toEqual("Unlike");
|
||||
expect(testComponentTree).toMatchSnapshot(
|
||||
'Should apply optimistic update. Button should says "Unlike". And it should be disabled'
|
||||
'Should apply optimistic update. Button should says "Unlike". And it should be disabled',
|
||||
);
|
||||
await ReactTestRenderer.act(async () => {
|
||||
client.mock.resolveMostRecentOperation((operation) =>
|
||||
|
@ -300,19 +300,19 @@ describe("ReactRelayTestMocker with Containers", () => {
|
|||
doesViewerLike: true,
|
||||
};
|
||||
},
|
||||
})
|
||||
}),
|
||||
);
|
||||
});
|
||||
expect(likeButton.props.disabled).toBe(false);
|
||||
expect(likeButton.props.children).toEqual("Unlike");
|
||||
expect(testComponentTree).toMatchSnapshot(
|
||||
'Should render response from the server. Button should be enabled. And text still "Unlike"'
|
||||
'Should render response from the server. Button should be enabled. And text still "Unlike"',
|
||||
);
|
||||
});
|
||||
|
||||
it("should reject mutation", async () => {
|
||||
const likeButton = testComponentTree.root.find(
|
||||
(node) => node.props.id === "likeButton"
|
||||
(node) => node.props.id === "likeButton",
|
||||
);
|
||||
// Should apply optimistic updates
|
||||
ReactTestRenderer.act(() => {
|
||||
|
@ -321,7 +321,7 @@ describe("ReactRelayTestMocker with Containers", () => {
|
|||
|
||||
// Trigger error
|
||||
await ReactTestRenderer.act(() =>
|
||||
client.mock.rejectMostRecentOperation(new Error("Uh-oh"))
|
||||
client.mock.rejectMostRecentOperation(new Error("Uh-oh")),
|
||||
);
|
||||
expect(testComponentTree).toMatchSnapshot("Should render error message");
|
||||
});
|
||||
|
@ -410,7 +410,7 @@ describe("ReactRelayTestMocker with Containers", () => {
|
|||
testComponentTree = ReactTestRenderer.create(
|
||||
<ApolloProvider client={client}>
|
||||
<TestComponent />
|
||||
</ApolloProvider>
|
||||
</ApolloProvider>,
|
||||
);
|
||||
});
|
||||
await ReactTestRenderer.act(() =>
|
||||
|
@ -424,8 +424,8 @@ describe("ReactRelayTestMocker with Containers", () => {
|
|||
doesViewerLike: false,
|
||||
};
|
||||
},
|
||||
})
|
||||
)
|
||||
}),
|
||||
),
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -435,13 +435,13 @@ describe("ReactRelayTestMocker with Containers", () => {
|
|||
});
|
||||
|
||||
const reaction = testComponentTree.root.find(
|
||||
(node) => node.props.id === "reaction"
|
||||
(node) => node.props.id === "reaction",
|
||||
);
|
||||
expect(reaction.props.children).toBe("Viewer does not like it");
|
||||
|
||||
const operation = client.mock.getMostRecentOperation();
|
||||
expect(getOperationName(operation.request.node)).toBe(
|
||||
"RelayMockEnvironmentWithComponentsTestRemarkableFixSubscription"
|
||||
"RelayMockEnvironmentWithComponentsTestRemarkableFixSubscription",
|
||||
);
|
||||
expect(operation.request.variables).toEqual({
|
||||
input: {
|
||||
|
@ -459,8 +459,8 @@ describe("ReactRelayTestMocker with Containers", () => {
|
|||
doesViewerLike: true,
|
||||
};
|
||||
},
|
||||
})
|
||||
)
|
||||
}),
|
||||
),
|
||||
);
|
||||
expect(reaction.props.children).toBe("Viewer likes it");
|
||||
});
|
||||
|
@ -533,12 +533,12 @@ describe("ReactRelayTestMocker with Containers", () => {
|
|||
const userQuery = client.mock.findOperation(
|
||||
(operation) =>
|
||||
getOperationName(operation.request.node) ===
|
||||
"RelayMockEnvironmentWithComponentsTestSwiftPerformanceQuery"
|
||||
"RelayMockEnvironmentWithComponentsTestSwiftPerformanceQuery",
|
||||
);
|
||||
const pageQuery = client.mock.findOperation(
|
||||
(operation) =>
|
||||
getOperationName(operation.request.node) ===
|
||||
"RelayMockEnvironmentWithComponentsTestRedefiningSolutionQuery"
|
||||
"RelayMockEnvironmentWithComponentsTestRedefiningSolutionQuery",
|
||||
);
|
||||
await ReactTestRenderer.act(async () => {
|
||||
client.mock.resolve(
|
||||
|
@ -548,7 +548,7 @@ describe("ReactRelayTestMocker with Containers", () => {
|
|||
id: userQuery.request.variables.userId,
|
||||
name: "Alice",
|
||||
}),
|
||||
})
|
||||
}),
|
||||
);
|
||||
client.mock.resolve(
|
||||
pageQuery,
|
||||
|
@ -557,14 +557,16 @@ describe("ReactRelayTestMocker with Containers", () => {
|
|||
id: pageQuery.request.variables.pageId,
|
||||
name: "My Page",
|
||||
}),
|
||||
})
|
||||
}),
|
||||
);
|
||||
});
|
||||
expect(
|
||||
testComponentTree.root.find((node) => node.props.id === "user").children
|
||||
testComponentTree.root.find((node) => node.props.id === "user")
|
||||
.children,
|
||||
).toEqual(["Alice"]);
|
||||
expect(
|
||||
testComponentTree.root.find((node) => node.props.id === "page").children
|
||||
testComponentTree.root.find((node) => node.props.id === "page")
|
||||
.children,
|
||||
).toEqual(["My Page"]);
|
||||
expect(testComponentTree).toMatchSnapshot();
|
||||
});
|
||||
|
@ -600,18 +602,18 @@ describe("ReactRelayTestMocker with Containers", () => {
|
|||
|
||||
it("should resolve next operation", async () => {
|
||||
client.mock.queueOperationResolver((operation) =>
|
||||
MockPayloadGenerator.generate(operation)
|
||||
MockPayloadGenerator.generate(operation),
|
||||
);
|
||||
let testComponentTree;
|
||||
await ReactTestRenderer.act(async () => {
|
||||
testComponentTree = ReactTestRenderer.create(
|
||||
<ApolloProvider client={client}>
|
||||
<TestComponent />
|
||||
</ApolloProvider>
|
||||
</ApolloProvider>,
|
||||
);
|
||||
});
|
||||
expect(testComponentTree).toMatchSnapshot(
|
||||
"should render component with the data"
|
||||
"should render component with the data",
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -622,11 +624,11 @@ describe("ReactRelayTestMocker with Containers", () => {
|
|||
testComponentTree = ReactTestRenderer.create(
|
||||
<ApolloProvider client={client}>
|
||||
<TestComponent />
|
||||
</ApolloProvider>
|
||||
</ApolloProvider>,
|
||||
);
|
||||
});
|
||||
expect(testComponentTree).toMatchSnapshot(
|
||||
"should render component with the error"
|
||||
"should render component with the error",
|
||||
);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -30,7 +30,7 @@ export interface OperationDescriptor<
|
|||
}
|
||||
|
||||
type OperationMockResolver<Schema = GraphQLSchema, Node = DocumentNode> = (
|
||||
operation: OperationDescriptor<Schema, Node>
|
||||
operation: OperationDescriptor<Schema, Node>,
|
||||
) => ExecutionResult | Error | undefined | null;
|
||||
|
||||
export interface MockFunctions<Schema = GraphQLSchema, Node = DocumentNode> {
|
||||
|
@ -49,7 +49,7 @@ export interface MockFunctions<Schema = GraphQLSchema, Node = DocumentNode> {
|
|||
* found.
|
||||
*/
|
||||
findOperation(
|
||||
findFn: (operation: OperationDescriptor<Schema, Node>) => boolean
|
||||
findFn: (operation: OperationDescriptor<Schema, Node>) => boolean,
|
||||
): OperationDescriptor<Schema, Node>;
|
||||
|
||||
/**
|
||||
|
@ -63,7 +63,7 @@ export interface MockFunctions<Schema = GraphQLSchema, Node = DocumentNode> {
|
|||
*/
|
||||
nextValue(
|
||||
operation: OperationDescriptor<Schema, Node>,
|
||||
data: ExecutionResult
|
||||
data: ExecutionResult,
|
||||
): Promise<void>;
|
||||
|
||||
/**
|
||||
|
@ -86,7 +86,7 @@ export interface MockFunctions<Schema = GraphQLSchema, Node = DocumentNode> {
|
|||
*/
|
||||
resolve(
|
||||
operation: OperationDescriptor<Schema, Node>,
|
||||
data: ExecutionResult
|
||||
data: ExecutionResult,
|
||||
): Promise<void>;
|
||||
|
||||
/**
|
||||
|
@ -99,7 +99,7 @@ export interface MockFunctions<Schema = GraphQLSchema, Node = DocumentNode> {
|
|||
*/
|
||||
reject(
|
||||
operation: OperationDescriptor<Schema, Node>,
|
||||
error: Error
|
||||
error: Error,
|
||||
): Promise<void>;
|
||||
|
||||
/**
|
||||
|
@ -111,7 +111,7 @@ export interface MockFunctions<Schema = GraphQLSchema, Node = DocumentNode> {
|
|||
* as per https://www.apollographql.com/docs/react/development-testing/testing/
|
||||
*/
|
||||
resolveMostRecentOperation(
|
||||
resolver: (operation: OperationDescriptor<Schema, Node>) => ExecutionResult
|
||||
resolver: (operation: OperationDescriptor<Schema, Node>) => ExecutionResult,
|
||||
): Promise<void>;
|
||||
|
||||
/**
|
||||
|
@ -122,14 +122,14 @@ export interface MockFunctions<Schema = GraphQLSchema, Node = DocumentNode> {
|
|||
* as per https://www.apollographql.com/docs/react/development-testing/testing/
|
||||
*/
|
||||
rejectMostRecentOperation(
|
||||
error: Error | ((operation: OperationDescriptor<Schema, Node>) => Error)
|
||||
error: Error | ((operation: OperationDescriptor<Schema, Node>) => Error),
|
||||
): Promise<void>;
|
||||
|
||||
/**
|
||||
* Adds a resolver function that will be used to resolve/reject operations as they appear.
|
||||
*/
|
||||
queueOperationResolver: (
|
||||
resolver: OperationMockResolver<Schema, Node>
|
||||
resolver: OperationMockResolver<Schema, Node>,
|
||||
) => Promise<void>;
|
||||
}
|
||||
|
||||
|
@ -168,7 +168,7 @@ class MockLink extends ApolloLink {
|
|||
variables: operation.variables || {},
|
||||
},
|
||||
},
|
||||
observer
|
||||
observer,
|
||||
);
|
||||
});
|
||||
}
|
||||
|
@ -177,7 +177,7 @@ class MockLink extends ApolloLink {
|
|||
function executeOperationMockResolver(
|
||||
resolver: OperationMockResolver,
|
||||
operation: OperationDescriptor,
|
||||
observer: ZenObservable.SubscriptionObserver<FetchResult>
|
||||
observer: ZenObservable.SubscriptionObserver<FetchResult>,
|
||||
) {
|
||||
const resolved = resolver(operation);
|
||||
if (resolved) {
|
||||
|
@ -207,7 +207,7 @@ class Mock implements MockFunctions {
|
|||
|
||||
public addOperation(
|
||||
operation: OperationDescriptor,
|
||||
observer: ZenObservable.SubscriptionObserver<FetchResult>
|
||||
observer: ZenObservable.SubscriptionObserver<FetchResult>,
|
||||
) {
|
||||
for (const resolver of this.resolversQueue) {
|
||||
if (executeOperationMockResolver(resolver, operation, observer)) {
|
||||
|
@ -236,13 +236,13 @@ class Mock implements MockFunctions {
|
|||
const operations = this.getAllOperations();
|
||||
invariant(
|
||||
operations.length > 0,
|
||||
"Expected at least one operation to have been started"
|
||||
"Expected at least one operation to have been started",
|
||||
);
|
||||
return operations[operations.length - 1];
|
||||
}
|
||||
|
||||
public findOperation(
|
||||
findFn: (operation: OperationDescriptor) => boolean
|
||||
findFn: (operation: OperationDescriptor) => boolean,
|
||||
): OperationDescriptor {
|
||||
let result: OperationDescriptor | null = null;
|
||||
for (const operation of this.operations.keys()) {
|
||||
|
@ -253,14 +253,14 @@ class Mock implements MockFunctions {
|
|||
}
|
||||
invariant(
|
||||
result,
|
||||
"Operation was not found in the list of pending operations"
|
||||
"Operation was not found in the list of pending operations",
|
||||
);
|
||||
return result;
|
||||
}
|
||||
|
||||
public async nextValue(
|
||||
operation: OperationDescriptor,
|
||||
data: ExecutionResult
|
||||
data: ExecutionResult,
|
||||
): Promise<void> {
|
||||
this.getObserver(operation).next(data);
|
||||
}
|
||||
|
@ -273,7 +273,7 @@ class Mock implements MockFunctions {
|
|||
|
||||
public async resolve(
|
||||
operation: OperationDescriptor,
|
||||
data: ExecutionResult
|
||||
data: ExecutionResult,
|
||||
): Promise<void> {
|
||||
this.nextValue(operation, data);
|
||||
this.complete(operation);
|
||||
|
@ -281,26 +281,26 @@ class Mock implements MockFunctions {
|
|||
|
||||
public async reject(
|
||||
operation: OperationDescriptor,
|
||||
error: Error
|
||||
error: Error,
|
||||
): Promise<void> {
|
||||
this.getObserver(operation).error(error);
|
||||
this.complete(operation);
|
||||
}
|
||||
|
||||
public async resolveMostRecentOperation(
|
||||
resolver: (operation: OperationDescriptor) => ExecutionResult
|
||||
resolver: (operation: OperationDescriptor) => ExecutionResult,
|
||||
): Promise<void> {
|
||||
const operation = this.getMostRecentOperation();
|
||||
this.resolve(operation, resolver(operation));
|
||||
}
|
||||
|
||||
public async rejectMostRecentOperation(
|
||||
error: Error | ((operation: OperationDescriptor) => Error)
|
||||
error: Error | ((operation: OperationDescriptor) => Error),
|
||||
): Promise<void> {
|
||||
const operation = this.getMostRecentOperation();
|
||||
this.reject(
|
||||
operation,
|
||||
typeof error === "function" ? error(operation) : error
|
||||
typeof error === "function" ? error(operation) : error,
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -348,6 +348,6 @@ export function createMockClient(schema: GraphQLSchema): ApolloMockClient {
|
|||
// mockClear() {
|
||||
// link.mockClear();
|
||||
// },
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
|
|
@ -1,16 +1,15 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
// @ts-nocheck
|
||||
;
|
||||
import { FragmentRefs } from "@graphitation/apollo-react-relay-duct-tape";
|
||||
export type hooksTestFragment = {
|
||||
readonly id: string;
|
||||
readonly name: string;
|
||||
readonly __typename: "User";
|
||||
readonly " $refType": "hooksTestFragment";
|
||||
readonly id: string;
|
||||
readonly name: string;
|
||||
readonly __typename: "User";
|
||||
readonly " $refType": "hooksTestFragment";
|
||||
};
|
||||
export type hooksTestFragment$data = hooksTestFragment;
|
||||
export type hooksTestFragment$key = {
|
||||
readonly " $data"?: hooksTestFragment$data;
|
||||
readonly " $fragmentRefs": FragmentRefs<"hooksTestFragment">;
|
||||
readonly " $data"?: hooksTestFragment$data;
|
||||
readonly " $fragmentRefs": FragmentRefs<"hooksTestFragment">;
|
||||
};
|
||||
|
|
|
@ -1,18 +1,17 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
// @ts-nocheck
|
||||
;
|
||||
import { FragmentRefs } from "@graphitation/apollo-react-relay-duct-tape";
|
||||
export type hooksTestMutationVariables = {
|
||||
id: string;
|
||||
name: string;
|
||||
id: string;
|
||||
name: string;
|
||||
};
|
||||
export type hooksTestMutationResponse = {
|
||||
readonly updateUserName: {
|
||||
readonly " $fragmentRefs": FragmentRefs<"hooksTestFragment">;
|
||||
};
|
||||
readonly updateUserName: {
|
||||
readonly " $fragmentRefs": FragmentRefs<"hooksTestFragment">;
|
||||
};
|
||||
};
|
||||
export type hooksTestMutation = {
|
||||
readonly response: hooksTestMutationResponse;
|
||||
readonly variables: hooksTestMutationVariables;
|
||||
readonly response: hooksTestMutationResponse;
|
||||
readonly variables: hooksTestMutationVariables;
|
||||
};
|
||||
|
|
|
@ -1,17 +1,16 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
// @ts-nocheck
|
||||
;
|
||||
import { FragmentRefs } from "@graphitation/apollo-react-relay-duct-tape";
|
||||
export type hooksTestQueryVariables = {
|
||||
id: string;
|
||||
id: string;
|
||||
};
|
||||
export type hooksTestQueryResponse = {
|
||||
readonly user: {
|
||||
readonly " $fragmentRefs": FragmentRefs<"hooksTestFragment">;
|
||||
};
|
||||
readonly user: {
|
||||
readonly " $fragmentRefs": FragmentRefs<"hooksTestFragment">;
|
||||
};
|
||||
};
|
||||
export type hooksTestQuery = {
|
||||
readonly response: hooksTestQueryResponse;
|
||||
readonly variables: hooksTestQueryVariables;
|
||||
readonly response: hooksTestQueryResponse;
|
||||
readonly variables: hooksTestQueryVariables;
|
||||
};
|
||||
|
|
|
@ -1,17 +1,16 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
// @ts-nocheck
|
||||
;
|
||||
import { FragmentRefs } from "@graphitation/apollo-react-relay-duct-tape";
|
||||
export type hooksTestSubscriptionVariables = {
|
||||
id: string;
|
||||
id: string;
|
||||
};
|
||||
export type hooksTestSubscriptionResponse = {
|
||||
readonly userNameChanged: {
|
||||
readonly " $fragmentRefs": FragmentRefs<"hooksTestFragment">;
|
||||
};
|
||||
readonly userNameChanged: {
|
||||
readonly " $fragmentRefs": FragmentRefs<"hooksTestFragment">;
|
||||
};
|
||||
};
|
||||
export type hooksTestSubscription = {
|
||||
readonly response: hooksTestSubscriptionResponse;
|
||||
readonly variables: hooksTestSubscriptionVariables;
|
||||
readonly response: hooksTestSubscriptionResponse;
|
||||
readonly variables: hooksTestSubscriptionVariables;
|
||||
};
|
||||
|
|
|
@ -30,7 +30,7 @@ import { hooksTestFragment$key } from "./__generated__/hooksTestFragment.graphql
|
|||
import { hooksTestMutation as hooksTestMutation$key } from "./__generated__/hooksTestMutation.graphql";
|
||||
|
||||
const schema = buildSchema(
|
||||
readFileSync(join(__dirname, "schema.graphql"), "utf8")
|
||||
readFileSync(join(__dirname, "schema.graphql"), "utf8"),
|
||||
);
|
||||
|
||||
/**
|
||||
|
@ -46,7 +46,7 @@ const fragment = graphql`
|
|||
`;
|
||||
|
||||
const FragmentComponent: React.FC<{ user: hooksTestFragment$key }> = (
|
||||
props
|
||||
props,
|
||||
) => {
|
||||
const user = useFragment(fragment, props.user);
|
||||
return <div id={user.__typename}>{user.name}</div>;
|
||||
|
@ -164,7 +164,7 @@ describe(useLazyLoadQuery, () => {
|
|||
tree = createTestRenderer(
|
||||
<ApolloProvider client={client}>
|
||||
<QueryComponent />
|
||||
</ApolloProvider>
|
||||
</ApolloProvider>,
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -173,7 +173,7 @@ describe(useLazyLoadQuery, () => {
|
|||
expect(operation.request.variables).toEqual({ id: "some-user-id" });
|
||||
|
||||
await act(() =>
|
||||
client.mock.resolve(operation, MockPayloadGenerator.generate(operation))
|
||||
client.mock.resolve(operation, MockPayloadGenerator.generate(operation)),
|
||||
);
|
||||
|
||||
expect(tree!.root.findByType("div").props).toMatchObject({
|
||||
|
@ -206,7 +206,7 @@ describe(useSubscription, () => {
|
|||
<SubscriptionComponent>
|
||||
<QueryComponent />
|
||||
</SubscriptionComponent>
|
||||
</ApolloProvider>
|
||||
</ApolloProvider>,
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -231,12 +231,12 @@ describe(useSubscription, () => {
|
|||
name: "user-name-from-query",
|
||||
};
|
||||
},
|
||||
})
|
||||
)
|
||||
}),
|
||||
),
|
||||
);
|
||||
// ...and verify
|
||||
expect(tree!.root.findByType("div").props.children).toEqual(
|
||||
"user-name-from-query"
|
||||
"user-name-from-query",
|
||||
);
|
||||
|
||||
// Now update subscription...
|
||||
|
@ -250,12 +250,12 @@ describe(useSubscription, () => {
|
|||
name: "user-name-from-subscription",
|
||||
};
|
||||
},
|
||||
})
|
||||
)
|
||||
}),
|
||||
),
|
||||
);
|
||||
// ...and verify
|
||||
expect(tree!.root.findByType("div").props.children).toEqual(
|
||||
"user-name-from-subscription"
|
||||
"user-name-from-subscription",
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -267,14 +267,14 @@ describe(useSubscription, () => {
|
|||
createTestRenderer(
|
||||
<ApolloProvider client={client}>
|
||||
<SubscriptionComponent onNext={onNext} />
|
||||
</ApolloProvider>
|
||||
</ApolloProvider>,
|
||||
);
|
||||
});
|
||||
|
||||
await act(() =>
|
||||
client.mock.resolveMostRecentOperation((operation) =>
|
||||
MockPayloadGenerator.generate(operation)
|
||||
)
|
||||
MockPayloadGenerator.generate(operation),
|
||||
),
|
||||
);
|
||||
|
||||
expect(onNext).toHaveBeenCalledWith(
|
||||
|
@ -284,7 +284,7 @@ describe(useSubscription, () => {
|
|||
id: "<User-mock-id-1>",
|
||||
name: '<mock-value-for-field-"name">',
|
||||
},
|
||||
})
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -296,12 +296,12 @@ describe(useSubscription, () => {
|
|||
createTestRenderer(
|
||||
<ApolloProvider client={client}>
|
||||
<SubscriptionComponent onError={onError} />
|
||||
</ApolloProvider>
|
||||
</ApolloProvider>,
|
||||
);
|
||||
});
|
||||
|
||||
await act(() =>
|
||||
client.mock.rejectMostRecentOperation(() => expectedError)
|
||||
client.mock.rejectMostRecentOperation(() => expectedError),
|
||||
);
|
||||
|
||||
expect(onError).toHaveBeenCalledWith(expectedError);
|
||||
|
@ -315,12 +315,12 @@ describe(useSubscription, () => {
|
|||
createTestRenderer(
|
||||
<ApolloProvider client={client}>
|
||||
<SubscriptionComponent onError={null} />
|
||||
</ApolloProvider>
|
||||
</ApolloProvider>,
|
||||
);
|
||||
});
|
||||
|
||||
await act(() =>
|
||||
client.mock.rejectMostRecentOperation(() => new Error("Oh noes"))
|
||||
client.mock.rejectMostRecentOperation(() => new Error("Oh noes")),
|
||||
);
|
||||
|
||||
expect(spy).toHaveBeenCalledWith(expect.stringContaining("Oh noes"));
|
||||
|
@ -337,7 +337,7 @@ describe("useMutation", () => {
|
|||
variables={{ name: "foo", id: "1" }}
|
||||
optimisticResponse={null}
|
||||
/>
|
||||
</ApolloProvider>
|
||||
</ApolloProvider>,
|
||||
);
|
||||
expect(tree).toMatchInlineSnapshot(`
|
||||
<div>
|
||||
|
@ -358,7 +358,7 @@ describe("useMutation", () => {
|
|||
},
|
||||
}}
|
||||
/>
|
||||
</ApolloProvider>
|
||||
</ApolloProvider>,
|
||||
);
|
||||
});
|
||||
expect(tree).toMatchInlineSnapshot(`
|
||||
|
@ -368,7 +368,7 @@ describe("useMutation", () => {
|
|||
`);
|
||||
await act(async () => {
|
||||
await client.mock.resolveMostRecentOperation((operation) =>
|
||||
MockPayloadGenerator.generate(operation)
|
||||
MockPayloadGenerator.generate(operation),
|
||||
);
|
||||
});
|
||||
expect(tree).toMatchInlineSnapshot(`
|
||||
|
|
|
@ -60,7 +60,7 @@ export type GraphQLTaggedNode = DocumentNode;
|
|||
export function useLazyLoadQuery<TQuery extends OperationType>(
|
||||
query: GraphQLTaggedNode,
|
||||
variables: TQuery["variables"],
|
||||
options?: { fetchPolicy: "cache-first" }
|
||||
options?: { fetchPolicy: "cache-first" },
|
||||
): { error?: Error; data?: TQuery["response"] } {
|
||||
return useApolloQuery(query as any, { variables, ...options });
|
||||
}
|
||||
|
@ -131,7 +131,7 @@ export function useLazyLoadQuery<TQuery extends OperationType>(
|
|||
*/
|
||||
export function useFragment<TKey extends KeyType>(
|
||||
_fragmentInput: GraphQLTaggedNode,
|
||||
fragmentRef: TKey
|
||||
fragmentRef: TKey,
|
||||
): KeyTypeData<TKey> {
|
||||
return fragmentRef as unknown;
|
||||
}
|
||||
|
@ -150,7 +150,7 @@ interface GraphQLSubscriptionConfig<
|
|||
}
|
||||
|
||||
export function useSubscription<TSubscriptionPayload extends OperationType>(
|
||||
config: GraphQLSubscriptionConfig<TSubscriptionPayload>
|
||||
config: GraphQLSubscriptionConfig<TSubscriptionPayload>,
|
||||
): void {
|
||||
const { error } = useApolloSubscription(config.subscription, {
|
||||
variables: config.variables,
|
||||
|
@ -159,7 +159,7 @@ export function useSubscription<TSubscriptionPayload extends OperationType>(
|
|||
// https://github.com/apollographql/react-apollo/issues/3177#issuecomment-506758144
|
||||
invariant(
|
||||
!subscriptionData.error,
|
||||
"Did not expect to receive an error here"
|
||||
"Did not expect to receive an error here",
|
||||
);
|
||||
if (subscriptionData.data && config.onNext) {
|
||||
config.onNext(subscriptionData.data);
|
||||
|
@ -171,7 +171,7 @@ export function useSubscription<TSubscriptionPayload extends OperationType>(
|
|||
config.onError(error);
|
||||
} else {
|
||||
console.warn(
|
||||
`An unhandled GraphQL subscription error occurred: ${error.message}`
|
||||
`An unhandled GraphQL subscription error occurred: ${error.message}`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -183,7 +183,7 @@ interface IMutationCommitterOptions<TMutationPayload extends OperationType> {
|
|||
}
|
||||
|
||||
type MutationCommiter<TMutationPayload extends OperationType> = (
|
||||
options: IMutationCommitterOptions<TMutationPayload>
|
||||
options: IMutationCommitterOptions<TMutationPayload>,
|
||||
) => Promise<{ errors?: Error[]; data?: TMutationPayload["response"] }>;
|
||||
|
||||
/**
|
||||
|
@ -234,10 +234,10 @@ type MutationCommiter<TMutationPayload extends OperationType> = (
|
|||
```
|
||||
*/
|
||||
export function useMutation<TMutationPayload extends OperationType>(
|
||||
mutation: GraphQLTaggedNode
|
||||
mutation: GraphQLTaggedNode,
|
||||
): [MutationCommiter<TMutationPayload>, boolean] {
|
||||
const [apolloUpdater, { loading: mutationLoading }] = useApolloMutation(
|
||||
mutation
|
||||
mutation,
|
||||
);
|
||||
|
||||
return [
|
||||
|
|
|
@ -2,4 +2,4 @@
|
|||
|
||||
This package contains eslint rules listed below
|
||||
|
||||
- missing-apollo-key-fields: Enforce selecting specific key fields when they are available on the GraphQL type
|
||||
- missing-apollo-key-fields: Enforce selecting specific key fields when they are available on the GraphQL type
|
||||
|
|
|
@ -137,5 +137,5 @@ ruleTester.runGraphQLTests(
|
|||
options: [{ typePolicies }],
|
||||
},
|
||||
],
|
||||
}
|
||||
},
|
||||
);
|
||||
|
|
|
@ -44,36 +44,36 @@ function getBaseType(type: GraphQLOutputType): GraphQLNamedType {
|
|||
|
||||
function checkRequiredParameters(
|
||||
ruleName: string,
|
||||
context: GraphQLESLintRuleContext
|
||||
context: GraphQLESLintRuleContext,
|
||||
) {
|
||||
if (!context.parserServices) {
|
||||
throw new Error(
|
||||
`Rule '${ruleName}' requires 'parserOptions.operations' to be set and loaded. See http://bit.ly/graphql-eslint-operations for more info`
|
||||
`Rule '${ruleName}' requires 'parserOptions.operations' to be set and loaded. See http://bit.ly/graphql-eslint-operations for more info`,
|
||||
);
|
||||
}
|
||||
|
||||
if (!context.parserServices.siblingOperations.available) {
|
||||
throw new Error(
|
||||
`Rule '${ruleName}' requires 'parserOptions.operations' to be set and loaded. See http://bit.ly/graphql-eslint-operations for more info`
|
||||
`Rule '${ruleName}' requires 'parserOptions.operations' to be set and loaded. See http://bit.ly/graphql-eslint-operations for more info`,
|
||||
);
|
||||
}
|
||||
|
||||
if (!context.parserServices.hasTypeInfo) {
|
||||
throw new Error(
|
||||
`Rule '${ruleName}' requires 'parserOptions.schema' to be set and schema to be loaded. See http://bit.ly/graphql-eslint-schema for more info`
|
||||
`Rule '${ruleName}' requires 'parserOptions.schema' to be set and schema to be loaded. See http://bit.ly/graphql-eslint-schema for more info`,
|
||||
);
|
||||
}
|
||||
|
||||
if (!context.options[0]?.typePolicies) {
|
||||
throw new Error(
|
||||
`Rule '${ruleName}' requires option 'typePolicies' to be set.`
|
||||
`Rule '${ruleName}' requires option 'typePolicies' to be set.`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
function keyFieldsForType(
|
||||
type: GraphQLObjectType | GraphQLInterfaceType,
|
||||
typePolicies: TypePolicies
|
||||
typePolicies: TypePolicies,
|
||||
) {
|
||||
const keyFields: string[] = [];
|
||||
const typePolicy = typePolicies[type.name];
|
||||
|
@ -125,8 +125,8 @@ function hasIdFieldInInterfaceSelectionSet(node: unknown, keyFields: string[]) {
|
|||
) {
|
||||
return keyFields.every((keyField) =>
|
||||
parentSelectionSetNode.selections.some(
|
||||
(s) => s.kind === "Field" && s.name.value === keyField
|
||||
)
|
||||
(s) => s.kind === "Field" && s.name.value === keyField,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -238,12 +238,12 @@ const missingApolloKeyFieldsRule: GraphQLESLintRule<
|
|||
}
|
||||
} else if (selection.kind === "FragmentSpread") {
|
||||
const foundSpread = siblings.getFragment(
|
||||
selection.name.value
|
||||
selection.name.value,
|
||||
);
|
||||
|
||||
if (foundSpread[0]) {
|
||||
checkedFragmentSpreads.add(
|
||||
foundSpread[0].document.name.value
|
||||
foundSpread[0].document.name.value,
|
||||
);
|
||||
|
||||
for (const fragmentSpreadSelection of foundSpread[0]
|
||||
|
@ -305,7 +305,7 @@ const missingApolloKeyFieldsRule: GraphQLESLintRule<
|
|||
|
||||
return fixer.insertTextBefore(
|
||||
firstSelection as any,
|
||||
`${unusedKeyFields.join(`\n`)}\n`
|
||||
`${unusedKeyFields.join(`\n`)}\n`,
|
||||
);
|
||||
},
|
||||
});
|
||||
|
|
|
@ -29,17 +29,17 @@ const {
|
|||
const schema = buildSchema(
|
||||
readFileSync(
|
||||
require.resolve("relay-test-utils-internal/lib/testschema.graphql"),
|
||||
"utf8"
|
||||
)
|
||||
"utf8",
|
||||
),
|
||||
);
|
||||
|
||||
function testGeneratedData(
|
||||
documentNode: DocumentNode,
|
||||
mockResolvers?: MockResolvers | null
|
||||
mockResolvers?: MockResolvers | null,
|
||||
): void {
|
||||
const payload = generate(
|
||||
{ schema, request: { node: documentNode, variables: {} } },
|
||||
mockResolvers
|
||||
mockResolvers,
|
||||
);
|
||||
expect({
|
||||
[FIXTURE_TAG]: true,
|
||||
|
@ -255,7 +255,7 @@ test("generate basic mock data", () => {
|
|||
}
|
||||
${fragment}
|
||||
`,
|
||||
null // Mock Resolvers
|
||||
null, // Mock Resolvers
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -286,7 +286,7 @@ xtest("generate mock using custom mock functions", () => {
|
|||
return "http://my-uri";
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -323,7 +323,7 @@ test("generate mock using custom mock functions for object type", () => {
|
|||
uri: "http://my-image",
|
||||
};
|
||||
},
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -357,7 +357,7 @@ test("generate mock for objects without concrete type", () => {
|
|||
name: "Mark",
|
||||
};
|
||||
},
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -401,7 +401,7 @@ xtest("generate mock using custom mock functions for object type (multiple objec
|
|||
uri: "http://my-image",
|
||||
};
|
||||
},
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -438,7 +438,7 @@ xtest("check context in the mock resolver", () => {
|
|||
uri: "http://my-image",
|
||||
};
|
||||
},
|
||||
}
|
||||
},
|
||||
);
|
||||
expect(checkContext).toMatchInlineSnapshot(`
|
||||
Object {
|
||||
|
@ -519,7 +519,7 @@ xtest("generate mock with manual mock for objects", () => {
|
|||
},
|
||||
};
|
||||
},
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -591,7 +591,7 @@ xtest("generate mock and verify arguments in the context", () => {
|
|||
};
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -623,7 +623,7 @@ xtest("generate mock for fragment with @argumentsDefinition", () => {
|
|||
height: 42,
|
||||
};
|
||||
},
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -831,7 +831,7 @@ xtest("should return `null` for selection if that is specified in default values
|
|||
actor: null,
|
||||
};
|
||||
},
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -907,7 +907,7 @@ describe("with @relay_test_operation", () => {
|
|||
name: "my-name",
|
||||
};
|
||||
},
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -930,7 +930,7 @@ describe("with @relay_test_operation", () => {
|
|||
name: "my-name",
|
||||
};
|
||||
},
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -971,7 +971,7 @@ describe("with @relay_test_operation", () => {
|
|||
name: "my-page-name",
|
||||
};
|
||||
},
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -1006,7 +1006,7 @@ describe("with @relay_test_operation", () => {
|
|||
name: "my-page-name",
|
||||
};
|
||||
},
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -1029,7 +1029,7 @@ describe("with @relay_test_operation", () => {
|
|||
name: "my-user-name",
|
||||
};
|
||||
},
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -1052,7 +1052,7 @@ describe("with @relay_test_operation", () => {
|
|||
name: null,
|
||||
};
|
||||
},
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -1076,7 +1076,7 @@ describe("with @relay_test_operation", () => {
|
|||
.map((__, idx) => `mock_email-${idx}-${generateId()}@fb.com`),
|
||||
};
|
||||
},
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -1098,7 +1098,7 @@ describe("with @relay_test_operation", () => {
|
|||
emailAddresses: [],
|
||||
};
|
||||
},
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -1132,7 +1132,7 @@ describe("with @relay_test_operation", () => {
|
|||
edges: Array(5).fill(null),
|
||||
};
|
||||
},
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -1166,7 +1166,7 @@ describe("with @relay_test_operation", () => {
|
|||
edges: [null, undefined],
|
||||
};
|
||||
},
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -1213,7 +1213,7 @@ describe("with @relay_test_operation", () => {
|
|||
],
|
||||
};
|
||||
},
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -1259,7 +1259,7 @@ describe("with @relay_test_operation", () => {
|
|||
],
|
||||
};
|
||||
},
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -1295,7 +1295,7 @@ describe("with @relay_test_operation", () => {
|
|||
edges: Array(2).fill(null),
|
||||
};
|
||||
},
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -1326,7 +1326,7 @@ describe("with @relay_test_operation", () => {
|
|||
},
|
||||
};
|
||||
},
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -1362,7 +1362,7 @@ describe("with @relay_test_operation", () => {
|
|||
},
|
||||
};
|
||||
},
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -1384,7 +1384,7 @@ describe("with @relay_test_operation", () => {
|
|||
emailAddresses: "my@email.com",
|
||||
};
|
||||
},
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -1406,7 +1406,7 @@ describe("with @relay_test_operation", () => {
|
|||
environment: "Web",
|
||||
};
|
||||
},
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -1428,7 +1428,7 @@ describe("with @relay_test_operation", () => {
|
|||
traits: ["CHEERFUL", "DERISIVE"],
|
||||
};
|
||||
},
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -1451,10 +1451,10 @@ describe("with @relay_test_operation", () => {
|
|||
environment: "INVALID_VALUE",
|
||||
};
|
||||
},
|
||||
}
|
||||
},
|
||||
);
|
||||
}).toThrow(
|
||||
'RelayMockPayloadGenerator: Invalid value "INVALID_VALUE" provided for enum field'
|
||||
'RelayMockPayloadGenerator: Invalid value "INVALID_VALUE" provided for enum field',
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -1476,7 +1476,7 @@ describe("with @relay_test_operation", () => {
|
|||
environment: null,
|
||||
};
|
||||
},
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -1492,7 +1492,7 @@ describe("with @relay_test_operation", () => {
|
|||
}
|
||||
}
|
||||
}
|
||||
`
|
||||
`,
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -1529,7 +1529,7 @@ describe("with @relay_test_operation", () => {
|
|||
__module_operation: require("./__generated__/RelayMockPayloadGeneratorTestMarkdownUserNameRenderer_name$normalization.graphql"),
|
||||
};
|
||||
},
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -1576,7 +1576,7 @@ describe("with @relay_test_operation", () => {
|
|||
__module_operation: require("./__generated__/RelayMockPayloadGeneratorTest1MarkdownUserNameRenderer_name$normalization.graphql"),
|
||||
};
|
||||
},
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -1623,7 +1623,7 @@ describe("with @relay_test_operation", () => {
|
|||
__module_operation: require("./__generated__/RelayMockPayloadGeneratorTest3PlainUserNameRenderer_name$normalization.graphql"),
|
||||
};
|
||||
},
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -1663,7 +1663,7 @@ describe("with @relay_test_operation", () => {
|
|||
},
|
||||
};
|
||||
},
|
||||
}
|
||||
},
|
||||
);
|
||||
}).toThrowErrorMatchingSnapshot();
|
||||
});
|
||||
|
@ -1698,7 +1698,7 @@ describe("with @relay_test_operation", () => {
|
|||
UserNameRenderer() {
|
||||
return null;
|
||||
},
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
});
|
||||
|
@ -1759,6 +1759,6 @@ test("deeply merges fragment data", () => {
|
|||
}
|
||||
${RelayMockPayloadGeneratorTestDeepMergeFragment1}
|
||||
${RelayMockPayloadGeneratorTestDeepMergeFragment2}
|
||||
`
|
||||
`,
|
||||
);
|
||||
});
|
||||
|
|
|
@ -66,14 +66,14 @@ const TYPENAME_KEY = "__typename";
|
|||
|
||||
export function generate(
|
||||
operation: OperationDescriptor,
|
||||
mockResolvers: MockResolvers | null = DEFAULT_MOCK_RESOLVERS
|
||||
mockResolvers: MockResolvers | null = DEFAULT_MOCK_RESOLVERS,
|
||||
) {
|
||||
mockResolvers = { ...DEFAULT_MOCK_RESOLVERS, ...mockResolvers };
|
||||
const resolveValue = createValueResolver(mockResolvers);
|
||||
const definitions = operation.request.node.definitions;
|
||||
|
||||
const operationDefinitionNode = definitions.find(
|
||||
(def) => def.kind === "OperationDefinition"
|
||||
(def) => def.kind === "OperationDefinition",
|
||||
) as OperationDefinitionNode | undefined;
|
||||
invariant(operationDefinitionNode, "Expected an operation definition node");
|
||||
|
||||
|
@ -82,7 +82,7 @@ export function generate(
|
|||
operation.schema,
|
||||
definitions,
|
||||
mockResolvers,
|
||||
resolveValue
|
||||
resolveValue,
|
||||
);
|
||||
|
||||
return { data: result };
|
||||
|
@ -108,7 +108,7 @@ function visitDocumentDefinitionNode(
|
|||
schema: GraphQLSchema,
|
||||
allDocumentDefinitionNodes: ReadonlyArray<DefinitionNode>,
|
||||
mockResolvers: MockResolvers,
|
||||
resolveValue: ValueResolver
|
||||
resolveValue: ValueResolver,
|
||||
): MockData {
|
||||
const typeInfo = new TypeInfo(schema);
|
||||
const visitor: VisitorWithMockData = {
|
||||
|
@ -150,14 +150,14 @@ function visitDocumentDefinitionNode(
|
|||
|
||||
const fragmentDefinitionNode = findFragmentDefinitionNode(
|
||||
allDocumentDefinitionNodes,
|
||||
fragmentSpreadNode.name.value
|
||||
fragmentSpreadNode.name.value,
|
||||
);
|
||||
return visitDocumentDefinitionNode(
|
||||
{ ...fragmentDefinitionNode, userMockData },
|
||||
schema,
|
||||
allDocumentDefinitionNodes,
|
||||
mockResolvers,
|
||||
resolveValue
|
||||
resolveValue,
|
||||
);
|
||||
},
|
||||
},
|
||||
|
@ -174,7 +174,7 @@ function visitDocumentDefinitionNode(
|
|||
: undefined,
|
||||
schema,
|
||||
allDocumentDefinitionNodes,
|
||||
typeInfo
|
||||
typeInfo,
|
||||
);
|
||||
}
|
||||
},
|
||||
|
@ -194,7 +194,7 @@ function visitDocumentDefinitionNode(
|
|||
let typename = mocksData.find(
|
||||
(sel) =>
|
||||
typeof sel[TYPENAME_KEY] === "string" &&
|
||||
sel[TYPENAME_KEY] !== DEFAULT_MOCK_TYPENAME
|
||||
sel[TYPENAME_KEY] !== DEFAULT_MOCK_TYPENAME,
|
||||
)?.[TYPENAME_KEY];
|
||||
// ...otherwise use the current type, if it's an object type...
|
||||
if (!typename && isObjectType(type)) {
|
||||
|
@ -228,7 +228,7 @@ function visitDocumentDefinitionNode(
|
|||
const type = typeInfo.getType();
|
||||
invariant(
|
||||
type,
|
||||
`Expected field to have a type: ${JSON.stringify(fieldNode)}`
|
||||
`Expected field to have a type: ${JSON.stringify(fieldNode)}`,
|
||||
);
|
||||
const namedType = getNamedType(type);
|
||||
if (isScalarType(namedType)) {
|
||||
|
@ -238,7 +238,7 @@ function visitDocumentDefinitionNode(
|
|||
fieldNode,
|
||||
namedType,
|
||||
typeInfo.getParentType()!,
|
||||
resolveValue
|
||||
resolveValue,
|
||||
),
|
||||
};
|
||||
return fieldWithMockData;
|
||||
|
@ -251,7 +251,7 @@ function visitDocumentDefinitionNode(
|
|||
} else {
|
||||
invariant(
|
||||
fieldNode.selectionSet,
|
||||
"Expected field with selection set"
|
||||
"Expected field with selection set",
|
||||
);
|
||||
const fieldWithMockData: typeof fieldNode = {
|
||||
...fieldNode,
|
||||
|
@ -259,7 +259,7 @@ function visitDocumentDefinitionNode(
|
|||
fieldNode,
|
||||
assertCompositeType(namedType),
|
||||
typeInfo.getParentType()!,
|
||||
resolveValue
|
||||
resolveValue,
|
||||
),
|
||||
};
|
||||
return fieldWithMockData;
|
||||
|
@ -311,7 +311,7 @@ function reduceToSingleObjectTypeSelection(
|
|||
explicitTypename: string | undefined,
|
||||
schema: GraphQLSchema,
|
||||
allDocumentDefinitionNodes: ReadonlyArray<DefinitionNode>,
|
||||
typeInfo: TypeInfo
|
||||
typeInfo: TypeInfo,
|
||||
): SelectionSetNode {
|
||||
let reduceToObjectType: GraphQLObjectType | null = null;
|
||||
const reducer = (type: Maybe<GraphQLOutputType>) => {
|
||||
|
@ -344,27 +344,27 @@ function reduceToSingleObjectTypeSelection(
|
|||
FragmentSpread(fragmentSpreadNode) {
|
||||
const fragmentDefinitionNode = findFragmentDefinitionNode(
|
||||
allDocumentDefinitionNodes,
|
||||
fragmentSpreadNode.name.value
|
||||
fragmentSpreadNode.name.value,
|
||||
);
|
||||
const type = schema.getType(
|
||||
fragmentDefinitionNode.typeCondition.name.value
|
||||
fragmentDefinitionNode.typeCondition.name.value,
|
||||
);
|
||||
return reducer(type as GraphQLOutputType);
|
||||
},
|
||||
})
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
function findFragmentDefinitionNode(
|
||||
allDocumentDefinitionNodes: ReadonlyArray<DefinitionNode>,
|
||||
name: string
|
||||
name: string,
|
||||
) {
|
||||
const fragmentDefinitionNode = allDocumentDefinitionNodes.find(
|
||||
(def) => def.kind === "FragmentDefinition" && def.name.value === name
|
||||
(def) => def.kind === "FragmentDefinition" && def.name.value === name,
|
||||
) as FragmentDefinitionNode | undefined;
|
||||
invariant(
|
||||
fragmentDefinitionNode,
|
||||
`Expected a fragment by name '${name}' to exist`
|
||||
`Expected a fragment by name '${name}' to exist`,
|
||||
);
|
||||
return fragmentDefinitionNode;
|
||||
}
|
||||
|
@ -373,7 +373,7 @@ function mockScalar(
|
|||
fieldNode: FieldNode,
|
||||
type: GraphQLScalarType,
|
||||
parentType: GraphQLCompositeType,
|
||||
resolveValue: ValueResolver
|
||||
resolveValue: ValueResolver,
|
||||
) {
|
||||
if (fieldNode.name.value === TYPENAME_KEY) {
|
||||
return isAbstractType(parentType) ? DEFAULT_MOCK_TYPENAME : parentType.name;
|
||||
|
@ -382,7 +382,7 @@ function mockScalar(
|
|||
fieldNode.arguments &&
|
||||
fieldNode.arguments.reduce(
|
||||
(acc, arg) => ({ ...acc, [arg.name.value]: arg.value }),
|
||||
{}
|
||||
{},
|
||||
);
|
||||
const context: MockResolverContext = {
|
||||
name: fieldNode.name.value,
|
||||
|
@ -399,13 +399,13 @@ function mockCompositeType(
|
|||
fieldNode: FieldNode,
|
||||
type: GraphQLCompositeType,
|
||||
parentType: GraphQLCompositeType,
|
||||
resolveValue: ValueResolver
|
||||
resolveValue: ValueResolver,
|
||||
): MockData | undefined {
|
||||
const args =
|
||||
fieldNode.arguments &&
|
||||
fieldNode.arguments.reduce(
|
||||
(acc, arg) => ({ ...acc, [arg.name.value]: arg.value }),
|
||||
{}
|
||||
{},
|
||||
);
|
||||
const context: MockResolverContext = {
|
||||
name: fieldNode.name.value,
|
||||
|
|
|
@ -17,7 +17,7 @@ export type MockResolverContext = Readonly<{
|
|||
|
||||
type MockResolver = (
|
||||
context: MockResolverContext,
|
||||
generateId: () => number
|
||||
generateId: () => number,
|
||||
) => unknown;
|
||||
|
||||
export type MockResolvers = Record<string, MockResolver>;
|
||||
|
@ -31,7 +31,7 @@ export type ValueResolver = (
|
|||
typeName: string | null,
|
||||
context: MockResolverContext,
|
||||
plural: boolean,
|
||||
defaultValue?: unknown
|
||||
defaultValue?: unknown,
|
||||
) => unknown;
|
||||
|
||||
export const DEFAULT_MOCK_TYPENAME = "__MockObject";
|
||||
|
@ -68,7 +68,7 @@ function valueResolver(
|
|||
typeName: string | null,
|
||||
context: MockResolverContext,
|
||||
plural: boolean = false,
|
||||
defaultValue?: unknown
|
||||
defaultValue?: unknown,
|
||||
): unknown {
|
||||
const generateValue = (possibleDefaultValue: unknown) => {
|
||||
let mockValue;
|
||||
|
@ -94,13 +94,13 @@ function valueResolver(
|
|||
return plural === true
|
||||
? generateMockList(
|
||||
Array.isArray(defaultValue) ? defaultValue : Array(1).fill(null),
|
||||
generateValue
|
||||
generateValue,
|
||||
)
|
||||
: generateValue(defaultValue);
|
||||
}
|
||||
|
||||
export function createValueResolver(
|
||||
mockResolvers: MockResolvers | null
|
||||
mockResolvers: MockResolvers | null,
|
||||
): ValueResolver {
|
||||
const generateId = createIdGenerator();
|
||||
return valueResolver.bind(null, generateId, mockResolvers);
|
||||
|
@ -108,9 +108,9 @@ export function createValueResolver(
|
|||
|
||||
function generateMockList<T>(
|
||||
placeholderArray: ReadonlyArray<unknown>,
|
||||
generateListItem: (defaultValue: unknown) => T
|
||||
generateListItem: (defaultValue: unknown) => T,
|
||||
): ReadonlyArray<T> {
|
||||
return placeholderArray.map((possibleDefaultValue) =>
|
||||
generateListItem(possibleDefaultValue)
|
||||
generateListItem(possibleDefaultValue),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -47,12 +47,12 @@ export function graphql(
|
|||
): DocumentNode {
|
||||
invariant(
|
||||
document.map((s) => s.trim()).filter((s) => s.length > 0).length === 1,
|
||||
"Interpolations are only allowed at the end of the template."
|
||||
"Interpolations are only allowed at the end of the template.",
|
||||
);
|
||||
const documentNode = parse(document[0]);
|
||||
const definitions = new Set(documentNode.definitions);
|
||||
fragments.forEach((doc) =>
|
||||
doc.definitions.forEach((def) => definitions.add(def))
|
||||
doc.definitions.forEach((def) => definitions.add(def)),
|
||||
);
|
||||
return { kind: "Document", definitions: Array.from(definitions) };
|
||||
}
|
||||
|
|
|
@ -95,17 +95,17 @@ function visitSelectionSet(parentType, selectionSet, parentSource) {
|
|||
if (isScalarType(type)) {
|
||||
result[selection.name] = parentType.invokeFieldResolver(
|
||||
selection.name,
|
||||
parentSource
|
||||
parentSource,
|
||||
);
|
||||
} else if (isObjectType(type)) {
|
||||
const source = parentType.invokeFieldResolver(
|
||||
selection.name,
|
||||
parentSource
|
||||
parentSource,
|
||||
);
|
||||
result[selection.name] = visitSelectionSet(
|
||||
type,
|
||||
selection.selectionSet,
|
||||
source
|
||||
source,
|
||||
);
|
||||
} else {
|
||||
// ...
|
||||
|
@ -128,7 +128,7 @@ execute(
|
|||
name
|
||||
}
|
||||
}
|
||||
`)
|
||||
`),
|
||||
);
|
||||
```
|
||||
|
||||
|
|
|
@ -1 +1 @@
|
|||
{}
|
||||
{}
|
||||
|
|
|
@ -200,7 +200,7 @@ describe("executeWithoutSchema", () => {
|
|||
|
||||
async function compareResultsForExecuteWithSchema(
|
||||
query: string,
|
||||
variables?: Record<string, unknown>
|
||||
variables?: Record<string, unknown>,
|
||||
) {
|
||||
expect.assertions(1);
|
||||
const document = parse(query);
|
||||
|
@ -226,7 +226,7 @@ async function compareResultsForExecuteWithSchema(
|
|||
|
||||
async function compareResultsForExecuteWithoutSchema(
|
||||
query: string,
|
||||
variables: Record<string, unknown> = {}
|
||||
variables: Record<string, unknown> = {},
|
||||
) {
|
||||
expect.assertions(1);
|
||||
let fullResolvers: Resolvers<any, any> = {};
|
||||
|
@ -240,7 +240,7 @@ async function compareResultsForExecuteWithoutSchema(
|
|||
};
|
||||
const extractedResolvers: Resolvers<any, any> = extractImplicitTypes(
|
||||
typeDefs,
|
||||
getTypeByName
|
||||
getTypeByName,
|
||||
);
|
||||
fullResolvers = {
|
||||
...extractedResolvers,
|
||||
|
|
|
@ -14,14 +14,14 @@ describe(extractImplicitTypesToTypescript, () => {
|
|||
path.join(__dirname, "../benchmarks/swapi-schema/schema.graphql"),
|
||||
{
|
||||
encoding: "utf-8",
|
||||
}
|
||||
},
|
||||
);
|
||||
const sourceFile = extractImplicitTypesToTypescript(parse(typeDefs));
|
||||
const printer = ts.createPrinter();
|
||||
const printedSource = printer.printNode(
|
||||
ts.EmitHint.SourceFile,
|
||||
sourceFile,
|
||||
sourceFile
|
||||
sourceFile,
|
||||
);
|
||||
expect(printedSource).toMatchInlineSnapshot(`
|
||||
"import { GraphQLList, GraphQLNonNull, GraphQLID, GraphQLString, GraphQLInt, GraphQLFloat, GraphQLBoolean, GraphQLEnumType } from \\"graphql\\";
|
||||
|
@ -50,7 +50,7 @@ describe(extractImplicitTypes, () => {
|
|||
path.join(__dirname, "../benchmarks/swapi-schema/schema.graphql"),
|
||||
{
|
||||
encoding: "utf-8",
|
||||
}
|
||||
},
|
||||
);
|
||||
let resolvers: Resolvers = {};
|
||||
const getTypeByName = (name: string) => {
|
||||
|
|
|
@ -55,13 +55,13 @@ describe("subscribeWithSchema", () => {
|
|||
".subscribeWithSchema %s",
|
||||
async ({ name, document, variables }: TestCase) => {
|
||||
await compareResultsForSubscribeWithSchema(document, variables);
|
||||
}
|
||||
},
|
||||
);
|
||||
test.each(errorTestCases)(
|
||||
".subscribeWithSchema %s",
|
||||
async ({ name, document, variables }: TestCase) => {
|
||||
await compareErrorsForSubscribeWithSchema(document, variables);
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -70,19 +70,19 @@ describe("subscribeWithoutSchema", () => {
|
|||
".subscribeWithoutSchema %s",
|
||||
async ({ name, document, variables }: TestCase) => {
|
||||
await compareResultsForSubscribeWithoutSchema(document, variables);
|
||||
}
|
||||
},
|
||||
);
|
||||
test.each(errorTestCases)(
|
||||
".subscribeWithoutSchema %s",
|
||||
async ({ name, document, variables }: TestCase) => {
|
||||
await compareErrorsForSubscribeWithoutSchema(document, variables);
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
async function compareResultsForSubscribeWithSchema(
|
||||
query: string,
|
||||
variables?: Record<string, unknown>
|
||||
variables?: Record<string, unknown>,
|
||||
) {
|
||||
expect.assertions(1);
|
||||
const document = parse(query);
|
||||
|
@ -120,7 +120,7 @@ async function compareResultsForSubscribeWithSchema(
|
|||
|
||||
async function compareErrorsForSubscribeWithSchema(
|
||||
query: string,
|
||||
variables?: Record<string, unknown>
|
||||
variables?: Record<string, unknown>,
|
||||
) {
|
||||
expect.assertions(1);
|
||||
const document = parse(query);
|
||||
|
@ -161,7 +161,7 @@ async function compareErrorsForSubscribeWithSchema(
|
|||
|
||||
async function compareResultsForSubscribeWithoutSchema(
|
||||
query: string,
|
||||
variables: Record<string, unknown> = {}
|
||||
variables: Record<string, unknown> = {},
|
||||
) {
|
||||
expect.assertions(1);
|
||||
let fullResolvers: Resolvers<any, any> = {};
|
||||
|
@ -175,7 +175,7 @@ async function compareResultsForSubscribeWithoutSchema(
|
|||
};
|
||||
const extractedResolvers: Resolvers<any, any> = extractImplicitTypes(
|
||||
typeDefs,
|
||||
getTypeByName
|
||||
getTypeByName,
|
||||
);
|
||||
fullResolvers = {
|
||||
...extractedResolvers,
|
||||
|
@ -212,7 +212,7 @@ async function compareResultsForSubscribeWithoutSchema(
|
|||
|
||||
async function compareErrorsForSubscribeWithoutSchema(
|
||||
query: string,
|
||||
variables: Record<string, unknown> = {}
|
||||
variables: Record<string, unknown> = {},
|
||||
) {
|
||||
expect.assertions(1);
|
||||
let fullResolvers: Resolvers<any, any> = {};
|
||||
|
@ -227,7 +227,7 @@ async function compareErrorsForSubscribeWithoutSchema(
|
|||
|
||||
const extractedResolvers: Resolvers<any, any> = extractImplicitTypes(
|
||||
typeDefs,
|
||||
getTypeByName
|
||||
getTypeByName,
|
||||
);
|
||||
fullResolvers = {
|
||||
...extractedResolvers,
|
||||
|
|
|
@ -39,7 +39,7 @@ describe(addTypesToRequestDocument, () => {
|
|||
title
|
||||
}
|
||||
}
|
||||
`
|
||||
`,
|
||||
);
|
||||
|
||||
const operationNode = document.definitions[0] as OperationDefinitionNode;
|
||||
|
@ -63,7 +63,7 @@ describe(addTypesToRequestDocument, () => {
|
|||
fragment FilmFragment on Film {
|
||||
title
|
||||
}
|
||||
`
|
||||
`,
|
||||
);
|
||||
|
||||
const fragmentNode = document.definitions[0] as FragmentDefinitionNode;
|
||||
|
@ -94,7 +94,7 @@ describe(addTypesToRequestDocument, () => {
|
|||
}
|
||||
}
|
||||
}
|
||||
`
|
||||
`,
|
||||
);
|
||||
|
||||
const operationNode = document.definitions[0] as OperationDefinitionNode;
|
||||
|
@ -124,7 +124,7 @@ describe(addTypesToRequestDocument, () => {
|
|||
fragment FilmFragment on Film {
|
||||
actors
|
||||
}
|
||||
`
|
||||
`,
|
||||
);
|
||||
|
||||
const fragmentNode = document.definitions[0] as FragmentDefinitionNode;
|
||||
|
@ -158,7 +158,7 @@ describe(addTypesToRequestDocument, () => {
|
|||
title
|
||||
}
|
||||
}
|
||||
`
|
||||
`,
|
||||
);
|
||||
|
||||
const operationNode = document.definitions[0] as OperationDefinitionNode;
|
||||
|
@ -188,7 +188,7 @@ describe(addTypesToRequestDocument, () => {
|
|||
title
|
||||
}
|
||||
}
|
||||
`
|
||||
`,
|
||||
);
|
||||
|
||||
const operationNode = document.definitions[0] as OperationDefinitionNode;
|
||||
|
|
|
@ -17,7 +17,7 @@ export * from "./TypedAST";
|
|||
|
||||
export function addTypesToRequestDocument(
|
||||
schema: GraphQLSchema,
|
||||
document: TypelessAST.DocumentNode
|
||||
document: TypelessAST.DocumentNode,
|
||||
): TypedAST.DocumentNode {
|
||||
const typeInfo = new TypeInfo(schema);
|
||||
return visit(
|
||||
|
@ -41,7 +41,7 @@ export function addTypesToRequestDocument(
|
|||
node: Omit<
|
||||
TypelessAST.FieldNode,
|
||||
"selectionSet" | "arguments" | "directives"
|
||||
>
|
||||
>,
|
||||
) {
|
||||
const type = typeInfo.getType();
|
||||
if (type) {
|
||||
|
@ -54,7 +54,7 @@ export function addTypesToRequestDocument(
|
|||
}
|
||||
throw new Error(`Unhandled: ${type}`);
|
||||
},
|
||||
})
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ const query = fs.readFileSync(
|
|||
path.join(__dirname, "./fixtures/query1.graphql"),
|
||||
{
|
||||
encoding: "utf-8",
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
const parsedQuery = parse(query);
|
||||
|
|
|
@ -7,7 +7,7 @@ import resolvers from "./resolvers";
|
|||
export const typeDefs = parse(
|
||||
readFileSync(join(__dirname, "./schema.graphql"), {
|
||||
encoding: "utf-8",
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
export default makeExecutableSchema({
|
||||
|
|
|
@ -5,7 +5,7 @@ import { createAsyncIterator } from "iterall";
|
|||
const films: GraphQLFieldResolver<any, any, any> = (
|
||||
parent,
|
||||
args,
|
||||
{ models }
|
||||
{ models },
|
||||
) => {
|
||||
return models
|
||||
.getData("/films")
|
||||
|
@ -15,7 +15,7 @@ const films: GraphQLFieldResolver<any, any, any> = (
|
|||
const starships: GraphQLFieldResolver<any, any, any> = (
|
||||
parent,
|
||||
{ id },
|
||||
{ models }
|
||||
{ models },
|
||||
) => {
|
||||
return models
|
||||
.getData("/starships")
|
||||
|
@ -33,7 +33,7 @@ function people(key: string): GraphQLFieldResolver<any, any, any> {
|
|||
const vehicles: GraphQLFieldResolver<any, any, any> = (
|
||||
parent,
|
||||
args,
|
||||
{ models }
|
||||
{ models },
|
||||
) => {
|
||||
return models
|
||||
.getData("/vehicles")
|
||||
|
@ -43,7 +43,7 @@ const vehicles: GraphQLFieldResolver<any, any, any> = (
|
|||
const transports: GraphQLFieldResolver<any, any, any> = (
|
||||
parent,
|
||||
args,
|
||||
{ models }
|
||||
{ models },
|
||||
) => {
|
||||
return models
|
||||
.getData("/transport")
|
||||
|
@ -53,7 +53,7 @@ const transports: GraphQLFieldResolver<any, any, any> = (
|
|||
const planets: GraphQLFieldResolver<any, any, any> = (
|
||||
parent,
|
||||
args,
|
||||
{ models }
|
||||
{ models },
|
||||
) => {
|
||||
return models
|
||||
.getData("/planets")
|
||||
|
@ -63,7 +63,7 @@ const planets: GraphQLFieldResolver<any, any, any> = (
|
|||
const species: GraphQLFieldResolver<any, any, any> = (
|
||||
parent,
|
||||
args,
|
||||
{ models }
|
||||
{ models },
|
||||
) => {
|
||||
return models
|
||||
.getData("/species")
|
||||
|
@ -72,7 +72,7 @@ const species: GraphQLFieldResolver<any, any, any> = (
|
|||
const homeworld: GraphQLFieldResolver<any, any, any> = (
|
||||
parent,
|
||||
args,
|
||||
{ models }
|
||||
{ models },
|
||||
) => {
|
||||
return models
|
||||
.getData("/planets")
|
||||
|
@ -82,7 +82,7 @@ const homeworld: GraphQLFieldResolver<any, any, any> = (
|
|||
const person: GraphQLFieldResolver<any, any, any> = (
|
||||
parent,
|
||||
{ id },
|
||||
{ models }
|
||||
{ models },
|
||||
) => {
|
||||
return models.getData("/people").find((person: any) => person.id === id);
|
||||
};
|
||||
|
@ -90,7 +90,7 @@ const person: GraphQLFieldResolver<any, any, any> = (
|
|||
const planet: GraphQLFieldResolver<any, any, any> = (
|
||||
parent,
|
||||
{ id },
|
||||
{ models }
|
||||
{ models },
|
||||
) => {
|
||||
return models.getData("/planets").find((planet: any) => planet.id === id);
|
||||
};
|
||||
|
@ -98,7 +98,7 @@ const planet: GraphQLFieldResolver<any, any, any> = (
|
|||
const film: GraphQLFieldResolver<any, any, any> = (
|
||||
parent,
|
||||
{ id },
|
||||
{ models }
|
||||
{ models },
|
||||
) => {
|
||||
return models.getData("/films").find((film: any) => film.id === id);
|
||||
};
|
||||
|
@ -106,7 +106,7 @@ const film: GraphQLFieldResolver<any, any, any> = (
|
|||
const starship: GraphQLFieldResolver<any, any, any> = (
|
||||
parent,
|
||||
{ id },
|
||||
{ models }
|
||||
{ models },
|
||||
) => {
|
||||
return models
|
||||
.getData("/starships")
|
||||
|
@ -116,7 +116,7 @@ const starship: GraphQLFieldResolver<any, any, any> = (
|
|||
const transport: GraphQLFieldResolver<any, any, any> = (
|
||||
parent,
|
||||
{ id },
|
||||
{ models }
|
||||
{ models },
|
||||
) => {
|
||||
return models
|
||||
.getData("/transport")
|
||||
|
@ -126,7 +126,7 @@ const transport: GraphQLFieldResolver<any, any, any> = (
|
|||
const vehicle: GraphQLFieldResolver<any, any, any> = (
|
||||
parent,
|
||||
{ id },
|
||||
{ models }
|
||||
{ models },
|
||||
) => {
|
||||
return models.getData("/vehicles").find((vehicle: any) => vehicle.id === id);
|
||||
};
|
||||
|
@ -134,7 +134,7 @@ const vehicle: GraphQLFieldResolver<any, any, any> = (
|
|||
const searchPeopleByName: GraphQLFieldResolver<any, any, any> = (
|
||||
parent,
|
||||
{ search },
|
||||
{ models }
|
||||
{ models },
|
||||
) => {
|
||||
return models
|
||||
.getData("/people")
|
||||
|
@ -144,7 +144,7 @@ const searchPeopleByName: GraphQLFieldResolver<any, any, any> = (
|
|||
const searchPlanetsByName: GraphQLFieldResolver<any, any, any> = (
|
||||
parent,
|
||||
{ search },
|
||||
{ models }
|
||||
{ models },
|
||||
) => {
|
||||
return models
|
||||
.getData("/planets")
|
||||
|
@ -154,7 +154,7 @@ const searchPlanetsByName: GraphQLFieldResolver<any, any, any> = (
|
|||
const searchFilmsByTitle: GraphQLFieldResolver<any, any, any> = (
|
||||
parent,
|
||||
{ search },
|
||||
{ models }
|
||||
{ models },
|
||||
) => {
|
||||
return models
|
||||
.getData("/films")
|
||||
|
@ -164,7 +164,7 @@ const searchFilmsByTitle: GraphQLFieldResolver<any, any, any> = (
|
|||
const searchSpeciesByName: GraphQLFieldResolver<any, any, any> = (
|
||||
parent,
|
||||
{ search },
|
||||
{ models }
|
||||
{ models },
|
||||
) => {
|
||||
return models
|
||||
.getData("/species")
|
||||
|
@ -174,7 +174,7 @@ const searchSpeciesByName: GraphQLFieldResolver<any, any, any> = (
|
|||
const searchStarshipsByName: GraphQLFieldResolver<any, any, any> = (
|
||||
parent,
|
||||
{ search },
|
||||
{ models }
|
||||
{ models },
|
||||
) => {
|
||||
return models
|
||||
.getData("/starships")
|
||||
|
@ -184,7 +184,7 @@ const searchStarshipsByName: GraphQLFieldResolver<any, any, any> = (
|
|||
const searchVehiclesByName: GraphQLFieldResolver<any, any, any> = (
|
||||
parent,
|
||||
{ search },
|
||||
{ models }
|
||||
{ models },
|
||||
) => {
|
||||
return models
|
||||
.getData("/vehicles")
|
||||
|
@ -194,7 +194,7 @@ const searchVehiclesByName: GraphQLFieldResolver<any, any, any> = (
|
|||
const emitPersons: GraphQLFieldResolver<any, any, any> = async function (
|
||||
parent,
|
||||
{ limit, throwError },
|
||||
{ models }
|
||||
{ models },
|
||||
) {
|
||||
if (throwError) {
|
||||
throw new Error("error");
|
||||
|
@ -212,7 +212,7 @@ const emitPersons: GraphQLFieldResolver<any, any, any> = async function (
|
|||
const searchTransportsByName: GraphQLFieldResolver<any, any, any> = (
|
||||
parent,
|
||||
{ search },
|
||||
{ models }
|
||||
{ models },
|
||||
) => {
|
||||
return models
|
||||
.getData("/transport")
|
||||
|
@ -234,25 +234,25 @@ const resolvers: IExecutableSchemaDefinition["resolvers"] = {
|
|||
search(parent, { search }, { models }, info) {
|
||||
const result = [
|
||||
...searchFilmsByTitle(parent, { search }, { models }, info).map(
|
||||
(r: any) => (r.__typename = "Film") && r
|
||||
(r: any) => (r.__typename = "Film") && r,
|
||||
),
|
||||
...searchPeopleByName(parent, { search }, { models }, info).map(
|
||||
(r: any) => (r.__typename = "Person") && r
|
||||
(r: any) => (r.__typename = "Person") && r,
|
||||
),
|
||||
...searchPlanetsByName(parent, { search }, { models }, info).map(
|
||||
(r: any) => (r.__typename = "Planet") && r
|
||||
(r: any) => (r.__typename = "Planet") && r,
|
||||
),
|
||||
...searchSpeciesByName(parent, { search }, { models }, info).map(
|
||||
(r: any) => (r.__typename = "Species") && r
|
||||
(r: any) => (r.__typename = "Species") && r,
|
||||
),
|
||||
...searchStarshipsByName(parent, { search }, { models }, info).map(
|
||||
(r: any) => (r.__typename = "Starship") && r
|
||||
(r: any) => (r.__typename = "Starship") && r,
|
||||
),
|
||||
...searchTransportsByName(parent, { search }, { models }, info).map(
|
||||
(r: any) => (r.__typename = "Transport") && r
|
||||
(r: any) => (r.__typename = "Transport") && r,
|
||||
),
|
||||
...searchVehiclesByName(parent, { search }, { models }, info).map(
|
||||
(r: any) => (r.__typename = "Vehicle") && r
|
||||
(r: any) => (r.__typename = "Vehicle") && r,
|
||||
),
|
||||
];
|
||||
|
||||
|
|
|
@ -28,8 +28,8 @@ describe(supermassive, () => {
|
|||
expect(
|
||||
await fs.readFile(
|
||||
path.join(__dirname, "./fixtures/__generated__/schema.ts"),
|
||||
{ encoding: "utf-8" }
|
||||
)
|
||||
{ encoding: "utf-8" },
|
||||
),
|
||||
).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
|
|
@ -11,7 +11,7 @@ export function supermassive(): Command {
|
|||
.name("extract-schema")
|
||||
.argument("<files...>")
|
||||
.description(
|
||||
"extract implicit resolvers to a ts file from graphql typedefs"
|
||||
"extract implicit resolvers to a ts file from graphql typedefs",
|
||||
)
|
||||
.action(async (files: Array<string>) => {
|
||||
await typeDefsToImplicitResolversImpl(files);
|
||||
|
@ -20,7 +20,7 @@ export function supermassive(): Command {
|
|||
}
|
||||
|
||||
async function typeDefsToImplicitResolversImpl(
|
||||
files: Array<string>
|
||||
files: Array<string>,
|
||||
): Promise<void> {
|
||||
for (const file of files) {
|
||||
let fullPath: string;
|
||||
|
@ -40,13 +40,13 @@ async function typeDefsToImplicitResolversImpl(
|
|||
await fs.mkdir(tsDir, { recursive: true });
|
||||
const tsFileName = path.join(
|
||||
tsDir,
|
||||
path.basename(fullPath, path.extname(fullPath)) + ".ts"
|
||||
path.basename(fullPath, path.extname(fullPath)) + ".ts",
|
||||
);
|
||||
const printer = ts.createPrinter();
|
||||
await fs.writeFile(
|
||||
tsFileName,
|
||||
printer.printNode(ts.EmitHint.SourceFile, tsContents, tsContents),
|
||||
{ encoding: "utf-8" }
|
||||
{ encoding: "utf-8" },
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ export function collectFields(
|
|||
runtimeTypeName: string,
|
||||
selectionSet: SelectionSetNode,
|
||||
fields: Map<string, Array<FieldNode>>,
|
||||
visitedFragmentNames: Set<string>
|
||||
visitedFragmentNames: Set<string>,
|
||||
): Map<string, Array<FieldNode>> {
|
||||
for (const selection of selectionSet.selections) {
|
||||
switch (selection.kind) {
|
||||
|
@ -60,7 +60,7 @@ export function collectFields(
|
|||
runtimeTypeName,
|
||||
selection.selectionSet,
|
||||
fields,
|
||||
visitedFragmentNames
|
||||
visitedFragmentNames,
|
||||
);
|
||||
break;
|
||||
}
|
||||
|
@ -87,7 +87,7 @@ export function collectFields(
|
|||
runtimeTypeName,
|
||||
fragment.selectionSet,
|
||||
fields,
|
||||
visitedFragmentNames
|
||||
visitedFragmentNames,
|
||||
);
|
||||
break;
|
||||
}
|
||||
|
@ -103,7 +103,7 @@ export function collectFields(
|
|||
function shouldIncludeNode(
|
||||
resolvers: Resolvers,
|
||||
variableValues: { [variable: string]: unknown },
|
||||
node: SelectionNode
|
||||
node: SelectionNode,
|
||||
): boolean {
|
||||
if (!node.directives?.length) {
|
||||
return true;
|
||||
|
@ -113,7 +113,7 @@ function shouldIncludeNode(
|
|||
GraphQLSkipDirective,
|
||||
node as SelectionNode,
|
||||
resolvers,
|
||||
variableValues
|
||||
variableValues,
|
||||
);
|
||||
if (skip?.if === true) {
|
||||
return false;
|
||||
|
@ -123,7 +123,7 @@ function shouldIncludeNode(
|
|||
GraphQLIncludeDirective,
|
||||
node as SelectionNode,
|
||||
resolvers,
|
||||
variableValues
|
||||
variableValues,
|
||||
);
|
||||
|
||||
if (include?.if === false) {
|
||||
|
@ -138,7 +138,7 @@ function shouldIncludeNode(
|
|||
*/
|
||||
function doesFragmentConditionMatch(
|
||||
fragment: FragmentDefinitionNode | InlineFragmentNode,
|
||||
typeName: string
|
||||
typeName: string,
|
||||
): boolean {
|
||||
const typeConditionNode = fragment.typeCondition;
|
||||
if (!typeConditionNode) {
|
||||
|
|
|
@ -12,7 +12,7 @@ import { toObjMap } from "./jsutils/toObjMap";
|
|||
import { keyValMap } from "./jsutils/keyValMap";
|
||||
|
||||
export function defineArguments(
|
||||
config: GraphQLFieldConfigArgumentMap
|
||||
config: GraphQLFieldConfigArgumentMap,
|
||||
): ReadonlyArray<GraphQLArgument> {
|
||||
return Object.entries(config).map(([argName, argConfig]) => ({
|
||||
name: argName,
|
||||
|
@ -26,7 +26,7 @@ export function defineArguments(
|
|||
}
|
||||
|
||||
export function argsToArgsConfig(
|
||||
args: ReadonlyArray<GraphQLArgument>
|
||||
args: ReadonlyArray<GraphQLArgument>,
|
||||
): GraphQLFieldConfigArgumentMap {
|
||||
return keyValMap(
|
||||
args,
|
||||
|
@ -38,6 +38,6 @@ export function argsToArgsConfig(
|
|||
deprecationReason: arg.deprecationReason,
|
||||
extensions: arg.extensions,
|
||||
astNode: arg.astNode,
|
||||
})
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ export function isDirective(directive: unknown): directive is GraphQLDirective {
|
|||
export function assertDirective(directive: unknown): GraphQLDirective {
|
||||
if (!isDirective(directive)) {
|
||||
throw new Error(
|
||||
`Expected ${inspect(directive)} to be a GraphQL directive.`
|
||||
`Expected ${inspect(directive)} to be a GraphQL directive.`,
|
||||
);
|
||||
}
|
||||
return directive;
|
||||
|
@ -71,13 +71,13 @@ export class GraphQLDirective {
|
|||
devAssert(config.name, "Directive must be named.");
|
||||
devAssert(
|
||||
Array.isArray(config.locations),
|
||||
`@${config.name} locations must be an Array.`
|
||||
`@${config.name} locations must be an Array.`,
|
||||
);
|
||||
|
||||
const args = config.args ?? {};
|
||||
devAssert(
|
||||
isObjectLike(args) && !Array.isArray(args),
|
||||
`@${config.name} args must be an object with argument names as keys.`
|
||||
`@${config.name} args must be an object with argument names as keys.`,
|
||||
);
|
||||
|
||||
this.args = defineArguments(args);
|
||||
|
@ -190,7 +190,7 @@ export const GraphQLDeprecatedDirective: GraphQLDirective = new GraphQLDirective
|
|||
defaultValue: DEFAULT_DEPRECATION_REASON,
|
||||
},
|
||||
},
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
/**
|
||||
|
@ -207,7 +207,7 @@ export const GraphQLSpecifiedByDirective: GraphQLDirective = new GraphQLDirectiv
|
|||
description: "The URL that specifies the behaviour of this scalar.",
|
||||
},
|
||||
},
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
/**
|
||||
|
@ -219,7 +219,7 @@ export const specifiedDirectives: ReadonlyArray<GraphQLDirective> = Object.freez
|
|||
GraphQLSkipDirective,
|
||||
GraphQLDeprecatedDirective,
|
||||
GraphQLSpecifiedByDirective,
|
||||
]
|
||||
],
|
||||
);
|
||||
|
||||
export function isSpecifiedDirective(directive: GraphQLDirective): boolean {
|
||||
|
|
|
@ -103,7 +103,7 @@ export interface ExecutionContext {
|
|||
* a GraphQLError will be thrown immediately explaining the invalid input.
|
||||
*/
|
||||
export function executeWithoutSchema(
|
||||
args: ExecutionWithoutSchemaArgs
|
||||
args: ExecutionWithoutSchemaArgs,
|
||||
): PromiseOrValue<ExecutionResult> {
|
||||
const {
|
||||
resolvers,
|
||||
|
@ -129,7 +129,7 @@ export function executeWithoutSchema(
|
|||
variableValues,
|
||||
operationName,
|
||||
fieldResolver,
|
||||
typeResolver
|
||||
typeResolver,
|
||||
);
|
||||
|
||||
// Return early errors if execution context failed.
|
||||
|
@ -154,11 +154,11 @@ export function executeWithoutSchema(
|
|||
*/
|
||||
function buildResponse(
|
||||
exeContext: ExecutionContext,
|
||||
data: PromiseOrValue<ObjMap<unknown> | null>
|
||||
data: PromiseOrValue<ObjMap<unknown> | null>,
|
||||
): PromiseOrValue<ExecutionResult> {
|
||||
if (isPromise(data)) {
|
||||
return data.then((resolved: PromiseOrValue<ObjMap<unknown> | null>) =>
|
||||
buildResponse(exeContext, resolved)
|
||||
buildResponse(exeContext, resolved),
|
||||
);
|
||||
}
|
||||
return exeContext.errors.length === 0
|
||||
|
@ -174,14 +174,14 @@ function buildResponse(
|
|||
*/
|
||||
export function assertValidExecutionArguments(
|
||||
document: DocumentNode,
|
||||
rawVariableValues: Maybe<{ [variable: string]: unknown }>
|
||||
rawVariableValues: Maybe<{ [variable: string]: unknown }>,
|
||||
): void {
|
||||
devAssert(document, "Must provide document.");
|
||||
|
||||
// Variables, if provided, must be an object.
|
||||
devAssert(
|
||||
rawVariableValues == null || isObjectLike(rawVariableValues),
|
||||
"Variables must be provided as an Object where each property is a variable value. Perhaps look to see if an unparsed JSON string was provided."
|
||||
"Variables must be provided as an Object where each property is a variable value. Perhaps look to see if an unparsed JSON string was provided.",
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -201,7 +201,7 @@ export function buildExecutionContext(
|
|||
rawVariableValues: Maybe<{ [variable: string]: unknown }>,
|
||||
operationName: Maybe<string>,
|
||||
fieldResolver: Maybe<FunctionFieldResolver<unknown, unknown>>,
|
||||
typeResolver?: Maybe<TypeResolver<unknown, unknown>>
|
||||
typeResolver?: Maybe<TypeResolver<unknown, unknown>>,
|
||||
): Array<GraphQLError> | ExecutionContext {
|
||||
let operation: OperationDefinitionNode | undefined;
|
||||
const fragments: ObjMap<FragmentDefinitionNode> = Object.create(null);
|
||||
|
@ -212,7 +212,7 @@ export function buildExecutionContext(
|
|||
if (operation !== undefined) {
|
||||
return [
|
||||
new GraphQLError(
|
||||
"Must provide operation name if query contains multiple operations."
|
||||
"Must provide operation name if query contains multiple operations.",
|
||||
),
|
||||
];
|
||||
}
|
||||
|
@ -241,7 +241,7 @@ export function buildExecutionContext(
|
|||
resolvers,
|
||||
variableDefinitions,
|
||||
rawVariableValues ?? {},
|
||||
{ maxErrors: 50 }
|
||||
{ maxErrors: 50 },
|
||||
);
|
||||
|
||||
if (coercedVariableValues.errors) {
|
||||
|
@ -267,7 +267,7 @@ export function buildExecutionContext(
|
|||
function executeOperation(
|
||||
exeContext: ExecutionContext,
|
||||
operation: OperationDefinitionNode,
|
||||
rootValue: unknown
|
||||
rootValue: unknown,
|
||||
): PromiseOrValue<ObjMap<unknown> | null> {
|
||||
const typeName = getOperationRootTypeName(operation);
|
||||
const fields = collectFields(
|
||||
|
@ -277,7 +277,7 @@ function executeOperation(
|
|||
typeName,
|
||||
operation.selectionSet,
|
||||
new Map(),
|
||||
new Set()
|
||||
new Set(),
|
||||
);
|
||||
|
||||
const path = undefined;
|
||||
|
@ -312,7 +312,7 @@ function executeFieldsSerially(
|
|||
parentTypeName: string,
|
||||
sourceValue: unknown,
|
||||
path: Path | undefined,
|
||||
fields: Map<string, Array<FieldNode>>
|
||||
fields: Map<string, Array<FieldNode>>,
|
||||
): PromiseOrValue<ObjMap<unknown>> {
|
||||
return promiseReduce(
|
||||
fields.entries(),
|
||||
|
@ -323,7 +323,7 @@ function executeFieldsSerially(
|
|||
parentTypeName,
|
||||
sourceValue,
|
||||
fieldNodes,
|
||||
fieldPath
|
||||
fieldPath,
|
||||
);
|
||||
if (result === undefined) {
|
||||
return results;
|
||||
|
@ -337,7 +337,7 @@ function executeFieldsSerially(
|
|||
results[responseName] = result;
|
||||
return results;
|
||||
},
|
||||
Object.create(null)
|
||||
Object.create(null),
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -350,7 +350,7 @@ function executeFields(
|
|||
parentTypeName: string,
|
||||
sourceValue: unknown,
|
||||
path: Path | undefined,
|
||||
fields: Map<string, Array<FieldNode>>
|
||||
fields: Map<string, Array<FieldNode>>,
|
||||
): PromiseOrValue<ObjMap<unknown>> {
|
||||
const results = Object.create(null);
|
||||
let containsPromise = false;
|
||||
|
@ -362,7 +362,7 @@ function executeFields(
|
|||
parentTypeName,
|
||||
sourceValue,
|
||||
fieldNodes,
|
||||
fieldPath
|
||||
fieldPath,
|
||||
);
|
||||
|
||||
if (result !== undefined) {
|
||||
|
@ -395,7 +395,7 @@ function executeField(
|
|||
parentTypeName: string,
|
||||
source: unknown,
|
||||
fieldNodes: Array<FieldNode>,
|
||||
path: Path
|
||||
path: Path,
|
||||
): PromiseOrValue<unknown> {
|
||||
const fieldName = fieldNodes[0].name.value;
|
||||
|
||||
|
@ -436,7 +436,7 @@ function executeField(
|
|||
parentTypeName,
|
||||
returnTypeName,
|
||||
returnTypeNode,
|
||||
path
|
||||
path,
|
||||
);
|
||||
|
||||
// Get the resolve function, regardless of if its result is normal or abrupt (error).
|
||||
|
@ -447,7 +447,7 @@ function executeField(
|
|||
const args = getArgumentValues(
|
||||
exeContext.resolvers,
|
||||
fieldNodes[0],
|
||||
exeContext.variableValues
|
||||
exeContext.variableValues,
|
||||
);
|
||||
|
||||
// The resolve function's optional third argument is a context value that
|
||||
|
@ -466,8 +466,8 @@ function executeField(
|
|||
fieldNodes,
|
||||
info,
|
||||
path,
|
||||
resolved
|
||||
)
|
||||
resolved,
|
||||
),
|
||||
);
|
||||
} else {
|
||||
completed = completeValue(
|
||||
|
@ -476,7 +476,7 @@ function executeField(
|
|||
fieldNodes,
|
||||
info,
|
||||
path,
|
||||
result
|
||||
result,
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -487,7 +487,7 @@ function executeField(
|
|||
const error = locatedError(
|
||||
rawError,
|
||||
fieldNodes as ReadonlyArray<GraphQLASTNode>,
|
||||
pathToArray(path)
|
||||
pathToArray(path),
|
||||
);
|
||||
return handleFieldError(error, returnTypeNode, exeContext);
|
||||
});
|
||||
|
@ -497,7 +497,7 @@ function executeField(
|
|||
const error = locatedError(
|
||||
rawError,
|
||||
fieldNodes as ReadonlyArray<GraphQLASTNode>,
|
||||
pathToArray(path)
|
||||
pathToArray(path),
|
||||
);
|
||||
return handleFieldError(error, returnTypeNode, exeContext);
|
||||
}
|
||||
|
@ -513,7 +513,7 @@ export function buildResolveInfo(
|
|||
parentTypeName: string,
|
||||
returnTypeName: string,
|
||||
returnTypeNode: TypeNode,
|
||||
path: Path
|
||||
path: Path,
|
||||
): ResolveInfo {
|
||||
// The resolve function's optional fourth argument is a collection of
|
||||
// information about the current execution state.
|
||||
|
@ -534,7 +534,7 @@ export function buildResolveInfo(
|
|||
function handleFieldError(
|
||||
error: GraphQLError,
|
||||
returnTypeNode: TypeNode,
|
||||
exeContext: ExecutionContext
|
||||
exeContext: ExecutionContext,
|
||||
): null {
|
||||
// If the field type is non-nullable, then it is resolved without any
|
||||
// protection from errors, however it still properly locates the error.
|
||||
|
@ -575,7 +575,7 @@ function completeValue(
|
|||
fieldNodes: Array<FieldNode>,
|
||||
info: ResolveInfo,
|
||||
path: Path,
|
||||
result: unknown
|
||||
result: unknown,
|
||||
): PromiseOrValue<unknown> {
|
||||
// If result is an Error, throw a located error.
|
||||
if (result instanceof Error) {
|
||||
|
@ -591,11 +591,11 @@ function completeValue(
|
|||
fieldNodes,
|
||||
info,
|
||||
path,
|
||||
result
|
||||
result,
|
||||
);
|
||||
if (completed === null) {
|
||||
throw new Error(
|
||||
`Cannot return null for non-nullable field ${info.parentTypeName}.${info.fieldName}.`
|
||||
`Cannot return null for non-nullable field ${info.parentTypeName}.${info.fieldName}.`,
|
||||
);
|
||||
}
|
||||
return completed;
|
||||
|
@ -614,7 +614,7 @@ function completeValue(
|
|||
fieldNodes,
|
||||
info,
|
||||
path,
|
||||
result
|
||||
result,
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -643,7 +643,7 @@ function completeValue(
|
|||
fieldNodes,
|
||||
info,
|
||||
path,
|
||||
result
|
||||
result,
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -656,14 +656,14 @@ function completeValue(
|
|||
fieldNodes,
|
||||
info,
|
||||
path,
|
||||
result
|
||||
result,
|
||||
);
|
||||
}
|
||||
|
||||
// istanbul ignore next (Not reachable. All possible output types have been considered)
|
||||
invariant(
|
||||
false,
|
||||
"Cannot complete value of unexpected output type: " + inspect(returnType)
|
||||
"Cannot complete value of unexpected output type: " + inspect(returnType),
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -677,11 +677,11 @@ function completeListValue(
|
|||
fieldNodes: Array<FieldNode>,
|
||||
info: ResolveInfo,
|
||||
path: Path,
|
||||
result: unknown
|
||||
result: unknown,
|
||||
): PromiseOrValue<Array<unknown>> {
|
||||
if (!isIterableObject(result)) {
|
||||
throw new GraphQLError(
|
||||
`Expected Iterable, but did not find one for field "${info.parentTypeName}.${info.fieldName}".`
|
||||
`Expected Iterable, but did not find one for field "${info.parentTypeName}.${info.fieldName}".`,
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -702,8 +702,8 @@ function completeListValue(
|
|||
fieldNodes,
|
||||
info,
|
||||
itemPath,
|
||||
resolved
|
||||
)
|
||||
resolved,
|
||||
),
|
||||
);
|
||||
} else {
|
||||
completedItem = completeValue(
|
||||
|
@ -712,7 +712,7 @@ function completeListValue(
|
|||
fieldNodes,
|
||||
info,
|
||||
itemPath,
|
||||
item
|
||||
item,
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -724,7 +724,7 @@ function completeListValue(
|
|||
const error = locatedError(
|
||||
rawError,
|
||||
fieldNodes as ReadonlyArray<GraphQLASTNode>,
|
||||
pathToArray(itemPath)
|
||||
pathToArray(itemPath),
|
||||
);
|
||||
return handleFieldError(error, returnTypeNode, exeContext);
|
||||
});
|
||||
|
@ -734,7 +734,7 @@ function completeListValue(
|
|||
const error = locatedError(
|
||||
rawError,
|
||||
fieldNodes as ReadonlyArray<GraphQLASTNode>,
|
||||
pathToArray(itemPath)
|
||||
pathToArray(itemPath),
|
||||
);
|
||||
return handleFieldError(error, returnTypeNode, exeContext);
|
||||
}
|
||||
|
@ -749,13 +749,13 @@ function completeListValue(
|
|||
*/
|
||||
function completeLeafValue(
|
||||
returnType: GraphQLLeafType,
|
||||
result: unknown
|
||||
result: unknown,
|
||||
): unknown {
|
||||
const serializedResult = returnType.serialize(result);
|
||||
if (serializedResult === undefined) {
|
||||
throw new Error(
|
||||
`Expected a value of type "${inspect(returnType)}" but ` +
|
||||
`received: ${inspect(result)}`
|
||||
`received: ${inspect(result)}`,
|
||||
);
|
||||
}
|
||||
return serializedResult;
|
||||
|
@ -771,7 +771,7 @@ function completeAbstractValue(
|
|||
fieldNodes: Array<FieldNode>,
|
||||
info: ResolveInfo,
|
||||
path: Path,
|
||||
result: unknown
|
||||
result: unknown,
|
||||
): PromiseOrValue<ObjMap<unknown>> {
|
||||
const resolveTypeFn = returnType.__resolveType ?? exeContext.typeResolver;
|
||||
const contextValue = exeContext.contextValue;
|
||||
|
@ -785,8 +785,8 @@ function completeAbstractValue(
|
|||
fieldNodes,
|
||||
info,
|
||||
path,
|
||||
result
|
||||
)
|
||||
result,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -796,13 +796,13 @@ function completeAbstractValue(
|
|||
fieldNodes,
|
||||
info,
|
||||
path,
|
||||
result
|
||||
result,
|
||||
);
|
||||
}
|
||||
|
||||
function ensureValidRuntimeType(
|
||||
runtimeTypeName: unknown,
|
||||
exeContext: ExecutionContext
|
||||
exeContext: ExecutionContext,
|
||||
): string {
|
||||
if (typeof runtimeTypeName === "string") {
|
||||
const runtimeType: Resolver<any, any> =
|
||||
|
@ -834,13 +834,13 @@ function completeObjectValue(
|
|||
fieldNodes: Array<FieldNode>,
|
||||
info: ResolveInfo,
|
||||
path: Path,
|
||||
result: unknown
|
||||
result: unknown,
|
||||
): PromiseOrValue<ObjMap<unknown>> {
|
||||
// Collect sub-fields to execute to complete this value.
|
||||
const subFieldNodes = collectSubfields(
|
||||
exeContext,
|
||||
returnTypeName,
|
||||
fieldNodes
|
||||
fieldNodes,
|
||||
);
|
||||
return executeFields(exeContext, returnTypeName, result, path, subFieldNodes);
|
||||
}
|
||||
|
@ -848,11 +848,11 @@ function completeObjectValue(
|
|||
function invalidReturnTypeError(
|
||||
returnType: GraphQLObjectType,
|
||||
result: unknown,
|
||||
fieldNodes: Array<FieldNode>
|
||||
fieldNodes: Array<FieldNode>,
|
||||
): GraphQLError {
|
||||
return new GraphQLError(
|
||||
`Expected value of type "${returnType.name}" but got: ${inspect(result)}.`,
|
||||
fieldNodes as ReadonlyArray<GraphQLASTNode>
|
||||
fieldNodes as ReadonlyArray<GraphQLASTNode>,
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -865,7 +865,7 @@ function invalidReturnTypeError(
|
|||
function collectSubfields(
|
||||
exeContext: ExecutionContext,
|
||||
returnTypeName: string,
|
||||
fieldNodes: Array<FieldNode>
|
||||
fieldNodes: Array<FieldNode>,
|
||||
): Map<string, Array<FieldNode>> {
|
||||
let subFieldNodes = new Map();
|
||||
const visitedFragmentNames = new Set<string>();
|
||||
|
@ -878,7 +878,7 @@ function collectSubfields(
|
|||
returnTypeName,
|
||||
node.selectionSet,
|
||||
subFieldNodes,
|
||||
visitedFragmentNames
|
||||
visitedFragmentNames,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -896,7 +896,7 @@ function collectSubfields(
|
|||
* isTypeOf for the object being coerced, returning the first type that matches.
|
||||
*/
|
||||
export const defaultTypeResolver: TypeResolver<unknown, unknown> = function (
|
||||
value
|
||||
value,
|
||||
) {
|
||||
if (isObjectLike(value) && typeof value.__typename === "string") {
|
||||
return value.__typename;
|
||||
|
@ -925,7 +925,7 @@ export const defaultFieldResolver: FunctionFieldResolver<
|
|||
|
||||
// TODO(freiksenet): Custom root type names maybe?
|
||||
export function getOperationRootTypeName(
|
||||
operation: OperationDefinitionNode | OperationTypeDefinitionNode
|
||||
operation: OperationDefinitionNode | OperationTypeDefinitionNode,
|
||||
): string {
|
||||
switch (operation.operation) {
|
||||
case "query":
|
||||
|
|
|
@ -25,7 +25,7 @@ import { Resolvers } from "./types";
|
|||
|
||||
export function extractImplicitTypes<TSource = any, TContext = any>(
|
||||
document: DocumentNode,
|
||||
getTypeByName: (name: string) => GraphQLInputType
|
||||
getTypeByName: (name: string) => GraphQLInputType,
|
||||
): Resolvers<TSource, TContext> {
|
||||
const result: Resolvers<TSource, TContext> = Object.create(null);
|
||||
for (let astNode of document.definitions) {
|
||||
|
@ -70,7 +70,7 @@ function makeEnum(astNode: EnumTypeDefinitionNode) {
|
|||
|
||||
function makeInputObject(
|
||||
astNode: InputObjectTypeDefinitionNode,
|
||||
getTypeByName: (name: string) => GraphQLInputType
|
||||
getTypeByName: (name: string) => GraphQLInputType,
|
||||
) {
|
||||
const name = astNode.name.value;
|
||||
|
||||
|
@ -84,7 +84,7 @@ function makeInputObject(
|
|||
|
||||
function buildInputFieldMap(
|
||||
fieldNodes: ReadonlyArray<InputValueDefinitionNode>,
|
||||
getTypeByName: (name: string) => GraphQLInputType
|
||||
getTypeByName: (name: string) => GraphQLInputType,
|
||||
): GraphQLInputFieldConfigMap {
|
||||
const inputFieldMap = Object.create(null);
|
||||
for (const field of fieldNodes) {
|
||||
|
@ -106,7 +106,7 @@ function buildInputFieldMap(
|
|||
|
||||
function getWrappedType(
|
||||
type: TypeNode,
|
||||
getTypeByName: (name: string) => GraphQLInputType
|
||||
getTypeByName: (name: string) => GraphQLInputType,
|
||||
): GraphQLInputType {
|
||||
if (type.kind === Kind.LIST_TYPE) {
|
||||
return new GraphQLList(getWrappedType(type.type, getTypeByName));
|
||||
|
@ -118,7 +118,10 @@ function getWrappedType(
|
|||
}
|
||||
|
||||
function getDeprecationReason(
|
||||
node: EnumValueDefinitionNode | FieldDefinitionNode | InputValueDefinitionNode
|
||||
node:
|
||||
| EnumValueDefinitionNode
|
||||
| FieldDefinitionNode
|
||||
| InputValueDefinitionNode,
|
||||
): Maybe<string> {
|
||||
const deprecated = getDirectiveValues(GraphQLDeprecatedDirective, node);
|
||||
return deprecated?.reason;
|
||||
|
|
|
@ -23,7 +23,7 @@ const SPECIFIED_SCALARS: Record<string, string> = {
|
|||
};
|
||||
|
||||
export function extractImplicitTypesToTypescript(
|
||||
document: DocumentNode
|
||||
document: DocumentNode,
|
||||
): ts.SourceFile {
|
||||
const definitions: Array<ts.VariableStatement> = [];
|
||||
const imports: Array<string> = [
|
||||
|
@ -72,12 +72,12 @@ export function extractImplicitTypesToTypescript(
|
|||
imports.map((imp) =>
|
||||
factory.createImportSpecifier(
|
||||
undefined,
|
||||
factory.createIdentifier(imp)
|
||||
)
|
||||
)
|
||||
)
|
||||
factory.createIdentifier(imp),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
factory.createStringLiteral("graphql")
|
||||
factory.createStringLiteral("graphql"),
|
||||
);
|
||||
|
||||
const exportDefinition: ts.VariableStatement = factory.createVariableStatement(
|
||||
|
@ -92,26 +92,26 @@ export function extractImplicitTypesToTypescript(
|
|||
identifiers.map((def: string) =>
|
||||
factory.createShorthandPropertyAssignment(
|
||||
factory.createIdentifier(def),
|
||||
undefined
|
||||
)
|
||||
)
|
||||
)
|
||||
undefined,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
ts.NodeFlags.Const
|
||||
)
|
||||
ts.NodeFlags.Const,
|
||||
),
|
||||
);
|
||||
|
||||
return factory.createSourceFile(
|
||||
[importDefinition, ...definitions, exportDefinition],
|
||||
factory.createToken(ts.SyntaxKind.EndOfFileToken),
|
||||
0
|
||||
0,
|
||||
);
|
||||
}
|
||||
|
||||
function createDeclaration(
|
||||
name: string,
|
||||
decl: ts.Expression
|
||||
decl: ts.Expression,
|
||||
): ts.VariableStatement {
|
||||
return factory.createVariableStatement(
|
||||
undefined,
|
||||
|
@ -121,16 +121,16 @@ function createDeclaration(
|
|||
factory.createIdentifier(name),
|
||||
undefined,
|
||||
undefined,
|
||||
decl
|
||||
decl,
|
||||
),
|
||||
],
|
||||
ts.NodeFlags.Const
|
||||
)
|
||||
ts.NodeFlags.Const,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
function createScalarType(
|
||||
astNode: ScalarTypeDefinitionNode
|
||||
astNode: ScalarTypeDefinitionNode,
|
||||
): ts.VariableStatement {
|
||||
return createDeclaration(
|
||||
astNode.name.value,
|
||||
|
@ -142,22 +142,22 @@ function createScalarType(
|
|||
[
|
||||
factory.createPropertyAssignment(
|
||||
factory.createIdentifier("name"),
|
||||
factory.createStringLiteral(astNode.name.value)
|
||||
factory.createStringLiteral(astNode.name.value),
|
||||
),
|
||||
factory.createPropertyAssignment(
|
||||
factory.createIdentifier("description"),
|
||||
factory.createStringLiteral(astNode.description?.value || "")
|
||||
factory.createStringLiteral(astNode.description?.value || ""),
|
||||
),
|
||||
],
|
||||
true
|
||||
true,
|
||||
),
|
||||
]
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
function createInputObjectType(
|
||||
astNode: InputObjectTypeDefinitionNode
|
||||
astNode: InputObjectTypeDefinitionNode,
|
||||
): ts.VariableStatement {
|
||||
return createDeclaration(
|
||||
astNode.name.value,
|
||||
|
@ -169,11 +169,11 @@ function createInputObjectType(
|
|||
[
|
||||
factory.createPropertyAssignment(
|
||||
factory.createIdentifier("name"),
|
||||
factory.createStringLiteral(astNode.name.value)
|
||||
factory.createStringLiteral(astNode.name.value),
|
||||
),
|
||||
factory.createPropertyAssignment(
|
||||
factory.createIdentifier("description"),
|
||||
factory.createStringLiteral(astNode.description?.value || "")
|
||||
factory.createStringLiteral(astNode.description?.value || ""),
|
||||
),
|
||||
factory.createPropertyAssignment(
|
||||
factory.createIdentifier("fields"),
|
||||
|
@ -186,44 +186,44 @@ function createInputObjectType(
|
|||
factory.createParenthesizedExpression(
|
||||
factory.createObjectLiteralExpression(
|
||||
createInputFields(astNode.fields || []),
|
||||
true
|
||||
)
|
||||
)
|
||||
)
|
||||
true,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
true
|
||||
true,
|
||||
),
|
||||
]
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
function createInputFields(
|
||||
astNodes: ReadonlyArray<InputValueDefinitionNode>
|
||||
astNodes: ReadonlyArray<InputValueDefinitionNode>,
|
||||
): Array<ts.PropertyAssignment> {
|
||||
return astNodes.map((astNode: InputValueDefinitionNode) => {
|
||||
const fields = [
|
||||
factory.createPropertyAssignment(
|
||||
factory.createIdentifier("type"),
|
||||
createType(astNode.type)
|
||||
createType(astNode.type),
|
||||
),
|
||||
factory.createPropertyAssignment(
|
||||
factory.createIdentifier("description"),
|
||||
factory.createStringLiteral(astNode.description?.value || "")
|
||||
factory.createStringLiteral(astNode.description?.value || ""),
|
||||
),
|
||||
];
|
||||
if (astNode.defaultValue) {
|
||||
fields.push(
|
||||
factory.createPropertyAssignment(
|
||||
factory.createIdentifier("defaultValue"),
|
||||
createValue(astNode.defaultValue)
|
||||
)
|
||||
createValue(astNode.defaultValue),
|
||||
),
|
||||
);
|
||||
}
|
||||
return factory.createPropertyAssignment(
|
||||
factory.createIdentifier(astNode.name.value),
|
||||
factory.createObjectLiteralExpression(fields, true)
|
||||
factory.createObjectLiteralExpression(fields, true),
|
||||
);
|
||||
});
|
||||
}
|
||||
|
@ -238,11 +238,11 @@ function createEnumType(astNode: EnumTypeDefinitionNode): ts.VariableStatement {
|
|||
factory.createObjectLiteralExpression([
|
||||
factory.createPropertyAssignment(
|
||||
factory.createIdentifier("name"),
|
||||
factory.createStringLiteral(astNode.name.value)
|
||||
factory.createStringLiteral(astNode.name.value),
|
||||
),
|
||||
factory.createPropertyAssignment(
|
||||
factory.createIdentifier("description"),
|
||||
factory.createStringLiteral(astNode.description?.value || "")
|
||||
factory.createStringLiteral(astNode.description?.value || ""),
|
||||
),
|
||||
factory.createPropertyAssignment(
|
||||
factory.createIdentifier("values"),
|
||||
|
@ -254,40 +254,40 @@ function createEnumType(astNode: EnumTypeDefinitionNode): ts.VariableStatement {
|
|||
factory.createPropertyAssignment(
|
||||
factory.createIdentifier("description"),
|
||||
factory.createStringLiteral(
|
||||
valueNode.description?.value || ""
|
||||
)
|
||||
valueNode.description?.value || "",
|
||||
),
|
||||
),
|
||||
])
|
||||
)
|
||||
)
|
||||
)
|
||||
]),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
]),
|
||||
]
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
function createAbstractType(
|
||||
astNode: InterfaceTypeDefinitionNode | UnionTypeDefinitionNode
|
||||
astNode: InterfaceTypeDefinitionNode | UnionTypeDefinitionNode,
|
||||
): ts.VariableStatement {
|
||||
return createDeclaration(
|
||||
astNode.name.value,
|
||||
factory.createObjectLiteralExpression([
|
||||
factory.createPropertyAssignment(
|
||||
factory.createIdentifier("__resolveType"),
|
||||
factory.createIdentifier("undefined")
|
||||
factory.createIdentifier("undefined"),
|
||||
),
|
||||
])
|
||||
]),
|
||||
);
|
||||
}
|
||||
|
||||
function createObjectType(
|
||||
astNode: ObjectTypeDefinitionNode
|
||||
astNode: ObjectTypeDefinitionNode,
|
||||
): ts.VariableStatement {
|
||||
return createDeclaration(
|
||||
astNode.name.value,
|
||||
factory.createObjectLiteralExpression()
|
||||
factory.createObjectLiteralExpression(),
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -296,13 +296,13 @@ function createType(astNode: TypeNode): ts.Expression {
|
|||
return factory.createNewExpression(
|
||||
factory.createIdentifier("GraphQLList"),
|
||||
undefined,
|
||||
[createType(astNode.type)]
|
||||
[createType(astNode.type)],
|
||||
);
|
||||
} else if (astNode.kind === Kind.NON_NULL_TYPE) {
|
||||
return factory.createNewExpression(
|
||||
factory.createIdentifier("GraphQLNonNull"),
|
||||
undefined,
|
||||
[createType(astNode.type)]
|
||||
[createType(astNode.type)],
|
||||
);
|
||||
} else {
|
||||
if (SPECIFIED_SCALARS[astNode.name.value]) {
|
||||
|
@ -324,16 +324,16 @@ function createValue(astNode: ValueNode): ts.Expression {
|
|||
return factory.createNull();
|
||||
} else if (astNode.kind === Kind.LIST) {
|
||||
return factory.createArrayLiteralExpression(
|
||||
astNode.values.map((valueNode) => createValue(valueNode))
|
||||
astNode.values.map((valueNode) => createValue(valueNode)),
|
||||
);
|
||||
} else if (astNode.kind === Kind.OBJECT) {
|
||||
return factory.createObjectLiteralExpression(
|
||||
astNode.fields.map((fieldNode) =>
|
||||
factory.createPropertyAssignment(
|
||||
fieldNode.name.value,
|
||||
createValue(fieldNode.value)
|
||||
)
|
||||
)
|
||||
createValue(fieldNode.value),
|
||||
),
|
||||
),
|
||||
);
|
||||
} else {
|
||||
throw new Error("Invalid value");
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import type { Maybe } from './Maybe';
|
||||
import type { Maybe } from "./Maybe";
|
||||
|
||||
export interface Path {
|
||||
readonly prev: Path | undefined;
|
||||
|
|
|
@ -16,22 +16,22 @@ export function didYouMean(
|
|||
? [firstArg as string, secondArg]
|
||||
: [undefined, firstArg as ReadonlyArray<string>];
|
||||
|
||||
let message = ' Did you mean ';
|
||||
let message = " Did you mean ";
|
||||
if (subMessage) {
|
||||
message += subMessage + ' ';
|
||||
message += subMessage + " ";
|
||||
}
|
||||
|
||||
const suggestions = suggestionsArg.map((x) => `"${x}"`);
|
||||
switch (suggestions.length) {
|
||||
case 0:
|
||||
return '';
|
||||
return "";
|
||||
case 1:
|
||||
return message + suggestions[0] + '?';
|
||||
return message + suggestions[0] + "?";
|
||||
case 2:
|
||||
return message + suggestions[0] + ' or ' + suggestions[1] + '?';
|
||||
return message + suggestions[0] + " or " + suggestions[1] + "?";
|
||||
}
|
||||
|
||||
const selected = suggestions.slice(0, MAX_SUGGESTIONS);
|
||||
const lastItem = selected.pop();
|
||||
return message + selected.join(', ') + ', or ' + lastItem + '?';
|
||||
return message + selected.join(", ") + ", or " + lastItem + "?";
|
||||
}
|
||||
|
|
|
@ -13,11 +13,11 @@ function formatValue(
|
|||
seenValues: ReadonlyArray<unknown>,
|
||||
): string {
|
||||
switch (typeof value) {
|
||||
case 'string':
|
||||
case "string":
|
||||
return JSON.stringify(value);
|
||||
case 'function':
|
||||
return value.name ? `[function ${value.name}]` : '[function]';
|
||||
case 'object':
|
||||
case "function":
|
||||
return value.name ? `[function ${value.name}]` : "[function]";
|
||||
case "object":
|
||||
return formatObjectValue(value, seenValues);
|
||||
default:
|
||||
return String(value);
|
||||
|
@ -29,11 +29,11 @@ function formatObjectValue(
|
|||
previouslySeenValues: ReadonlyArray<unknown>,
|
||||
): string {
|
||||
if (value === null) {
|
||||
return 'null';
|
||||
return "null";
|
||||
}
|
||||
|
||||
if (previouslySeenValues.includes(value)) {
|
||||
return '[Circular]';
|
||||
return "[Circular]";
|
||||
}
|
||||
|
||||
const seenValues = [...previouslySeenValues, value];
|
||||
|
@ -43,7 +43,7 @@ function formatObjectValue(
|
|||
|
||||
// check for infinite recursion
|
||||
if (jsonValue !== value) {
|
||||
return typeof jsonValue === 'string'
|
||||
return typeof jsonValue === "string"
|
||||
? jsonValue
|
||||
: formatValue(jsonValue, seenValues);
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ function formatObjectValue(
|
|||
}
|
||||
|
||||
function isJSONable(value: any): value is { toJSON: () => unknown } {
|
||||
return typeof value.toJSON === 'function';
|
||||
return typeof value.toJSON === "function";
|
||||
}
|
||||
|
||||
function formatObject(
|
||||
|
@ -64,17 +64,17 @@ function formatObject(
|
|||
): string {
|
||||
const entries = Object.entries(object);
|
||||
if (entries.length === 0) {
|
||||
return '{}';
|
||||
return "{}";
|
||||
}
|
||||
|
||||
if (seenValues.length > MAX_RECURSIVE_DEPTH) {
|
||||
return '[' + getObjectTag(object) + ']';
|
||||
return "[" + getObjectTag(object) + "]";
|
||||
}
|
||||
|
||||
const properties = entries.map(
|
||||
([key, value]) => key + ': ' + formatValue(value, seenValues),
|
||||
([key, value]) => key + ": " + formatValue(value, seenValues),
|
||||
);
|
||||
return '{ ' + properties.join(', ') + ' }';
|
||||
return "{ " + properties.join(", ") + " }";
|
||||
}
|
||||
|
||||
function formatArray(
|
||||
|
@ -82,11 +82,11 @@ function formatArray(
|
|||
seenValues: ReadonlyArray<unknown>,
|
||||
): string {
|
||||
if (array.length === 0) {
|
||||
return '[]';
|
||||
return "[]";
|
||||
}
|
||||
|
||||
if (seenValues.length > MAX_RECURSIVE_DEPTH) {
|
||||
return '[Array]';
|
||||
return "[Array]";
|
||||
}
|
||||
|
||||
const len = Math.min(MAX_ARRAY_LENGTH, array.length);
|
||||
|
@ -98,23 +98,23 @@ function formatArray(
|
|||
}
|
||||
|
||||
if (remaining === 1) {
|
||||
items.push('... 1 more item');
|
||||
items.push("... 1 more item");
|
||||
} else if (remaining > 1) {
|
||||
items.push(`... ${remaining} more items`);
|
||||
}
|
||||
|
||||
return '[' + items.join(', ') + ']';
|
||||
return "[" + items.join(", ") + "]";
|
||||
}
|
||||
|
||||
function getObjectTag(object: object): string {
|
||||
const tag = Object.prototype.toString
|
||||
.call(object)
|
||||
.replace(/^\[object /, '')
|
||||
.replace(/]$/, '');
|
||||
.replace(/^\[object /, "")
|
||||
.replace(/]$/, "");
|
||||
|
||||
if (tag === 'Object' && typeof object.constructor === 'function') {
|
||||
if (tag === "Object" && typeof object.constructor === "function") {
|
||||
const name = object.constructor.name;
|
||||
if (typeof name === 'string' && name !== '') {
|
||||
if (typeof name === "string" && name !== "") {
|
||||
return name;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { inspect } from './inspect';
|
||||
import { inspect } from "./inspect";
|
||||
|
||||
/**
|
||||
* A replacement for instanceof which includes an error warning when multi-realm
|
||||
|
@ -7,7 +7,7 @@ import { inspect } from './inspect';
|
|||
* See: https://webpack.js.org/guides/production/
|
||||
*/
|
||||
export const instanceOf: (value: unknown, constructor: Constructor) => boolean =
|
||||
process.env.NODE_ENV === 'production'
|
||||
process.env.NODE_ENV === "production"
|
||||
? // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317')
|
||||
function instanceOf(value: unknown, constructor: Constructor): boolean {
|
||||
return value instanceof constructor;
|
||||
|
@ -16,7 +16,7 @@ export const instanceOf: (value: unknown, constructor: Constructor) => boolean =
|
|||
if (value instanceof constructor) {
|
||||
return true;
|
||||
}
|
||||
if (typeof value === 'object' && value !== null) {
|
||||
if (typeof value === "object" && value !== null) {
|
||||
// Prefer Symbol.toStringTag since it is immune to minification.
|
||||
const className = constructor.prototype[Symbol.toStringTag];
|
||||
const valueClassName =
|
||||
|
|
|
@ -6,7 +6,7 @@ export function invariant(
|
|||
// istanbul ignore else (See transformation done in './resources/inlineInvariant.js')
|
||||
if (!booleanCondition) {
|
||||
throw new Error(
|
||||
message != null ? message : 'Unexpected invariant triggered.',
|
||||
message != null ? message : "Unexpected invariant triggered.",
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,5 +5,5 @@
|
|||
export function isAsyncIterable(
|
||||
maybeAsyncIterable: any,
|
||||
): maybeAsyncIterable is AsyncIterable<unknown> {
|
||||
return typeof maybeAsyncIterable?.[Symbol.asyncIterator] === 'function';
|
||||
return typeof maybeAsyncIterable?.[Symbol.asyncIterator] === "function";
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ export function isIterableObject(
|
|||
maybeIterable: any,
|
||||
): maybeIterable is Iterable<unknown> {
|
||||
return (
|
||||
typeof maybeIterable === 'object' &&
|
||||
typeof maybeIterable?.[Symbol.iterator] === 'function'
|
||||
typeof maybeIterable === "object" &&
|
||||
typeof maybeIterable?.[Symbol.iterator] === "function"
|
||||
);
|
||||
}
|
||||
|
|
|
@ -5,5 +5,5 @@
|
|||
export function isObjectLike(
|
||||
value: unknown,
|
||||
): value is { [key: string]: unknown } {
|
||||
return typeof value == 'object' && value !== null;
|
||||
return typeof value == "object" && value !== null;
|
||||
}
|
||||
|
|
|
@ -3,5 +3,5 @@
|
|||
* otherwise returns false.
|
||||
*/
|
||||
export function isPromise(value: any): value is Promise<unknown> {
|
||||
return typeof value?.then === 'function';
|
||||
return typeof value?.then === "function";
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import type { ObjMap } from './ObjMap';
|
||||
import type { ObjMap } from "./ObjMap";
|
||||
|
||||
/**
|
||||
* Creates a keyed JS object from an array, given a function to produce the keys
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import type { ObjMap } from './ObjMap';
|
||||
import type { ObjMap } from "./ObjMap";
|
||||
|
||||
/**
|
||||
* Creates a keyed JS object from an array, given a function to produce the keys
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import type { ObjMap, ReadOnlyObjMap } from './ObjMap';
|
||||
import type { ObjMap, ReadOnlyObjMap } from "./ObjMap";
|
||||
|
||||
/**
|
||||
* Creates an object map with the same keys as `map` and values generated by
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
export function printPathArray(path: ReadonlyArray<string | number>): string {
|
||||
return path
|
||||
.map((key) =>
|
||||
typeof key === 'number' ? '[' + key.toString() + ']' : '.' + key,
|
||||
typeof key === "number" ? "[" + key.toString() + "]" : "." + key,
|
||||
)
|
||||
.join('');
|
||||
.join("");
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import type { ObjMap } from './ObjMap';
|
||||
import type { ObjMap } from "./ObjMap";
|
||||
|
||||
/**
|
||||
* This function transforms a JS object `ObjMap<Promise<T>>` into
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import type { PromiseOrValue } from './PromiseOrValue';
|
||||
import type { PromiseOrValue } from "./PromiseOrValue";
|
||||
|
||||
import { isPromise } from './isPromise';
|
||||
import { isPromise } from "./isPromise";
|
||||
|
||||
/**
|
||||
* Similar to Array.prototype.reduce(), however the reducing callback may return
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { naturalCompare } from './naturalCompare';
|
||||
import { naturalCompare } from "./naturalCompare";
|
||||
|
||||
/**
|
||||
* Given an invalid input string and a list of valid options, returns a filtered
|
||||
|
|
|
@ -3,7 +3,7 @@ import type {
|
|||
ObjMapLike,
|
||||
ReadOnlyObjMap,
|
||||
ReadOnlyObjMapLike,
|
||||
} from './ObjMap';
|
||||
} from "./ObjMap";
|
||||
|
||||
export function toObjMap<T>(obj: ObjMapLike<T>): ObjMap<T>;
|
||||
export function toObjMap<T>(obj: ReadOnlyObjMapLike<T>): ReadOnlyObjMap<T>;
|
||||
|
|
|
@ -56,7 +56,7 @@ import {
|
|||
* Accepts either an object with named arguments, or individual arguments.
|
||||
*/
|
||||
export async function subscribeWithoutSchema(
|
||||
args: ExecutionWithoutSchemaArgs
|
||||
args: ExecutionWithoutSchemaArgs,
|
||||
): Promise<AsyncGenerator<ExecutionResult, void, void> | ExecutionResult> {
|
||||
const {
|
||||
resolvers,
|
||||
|
@ -76,7 +76,7 @@ export async function subscribeWithoutSchema(
|
|||
contextValue,
|
||||
variableValues,
|
||||
operationName,
|
||||
subscribeFieldResolver
|
||||
subscribeFieldResolver,
|
||||
);
|
||||
|
||||
if (!isAsyncIterable(resultOrStream)) {
|
||||
|
@ -139,7 +139,7 @@ export async function createSourceEventStream(
|
|||
contextValue?: unknown,
|
||||
variableValues?: Maybe<{ readonly [variable: string]: unknown }>,
|
||||
operationName?: Maybe<string>,
|
||||
fieldResolver?: Maybe<FunctionFieldResolver<any, any>>
|
||||
fieldResolver?: Maybe<FunctionFieldResolver<any, any>>,
|
||||
): Promise<AsyncIterable<unknown> | ExecutionResult> {
|
||||
// If arguments are missing or incorrectly typed, this is an internal
|
||||
// developer mistake which should throw an early error.
|
||||
|
@ -154,7 +154,7 @@ export async function createSourceEventStream(
|
|||
contextValue,
|
||||
variableValues,
|
||||
operationName,
|
||||
fieldResolver
|
||||
fieldResolver,
|
||||
);
|
||||
|
||||
// Return early errors if execution context failed.
|
||||
|
@ -168,7 +168,7 @@ export async function createSourceEventStream(
|
|||
if (!isAsyncIterable(eventStream)) {
|
||||
throw new Error(
|
||||
"Subscription field must return Async Iterable. " +
|
||||
`Received: ${inspect(eventStream)}.`
|
||||
`Received: ${inspect(eventStream)}.`,
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -184,7 +184,7 @@ export async function createSourceEventStream(
|
|||
}
|
||||
|
||||
async function executeSubscription(
|
||||
exeContext: ExecutionContext
|
||||
exeContext: ExecutionContext,
|
||||
): Promise<unknown> {
|
||||
const {
|
||||
resolvers,
|
||||
|
@ -201,7 +201,7 @@ async function executeSubscription(
|
|||
typeName,
|
||||
operation.selectionSet,
|
||||
new Map(),
|
||||
new Set()
|
||||
new Set(),
|
||||
);
|
||||
|
||||
const [responseName, fieldNodes] = [...fields.entries()][0];
|
||||
|
@ -241,7 +241,7 @@ async function executeSubscription(
|
|||
typeName,
|
||||
returnTypeName,
|
||||
returnTypeNode,
|
||||
path
|
||||
path,
|
||||
);
|
||||
|
||||
try {
|
||||
|
@ -269,7 +269,7 @@ async function executeSubscription(
|
|||
throw locatedError(
|
||||
error,
|
||||
fieldNodes as ReadonlyArray<GraphQLASTNode>,
|
||||
pathToArray(path)
|
||||
pathToArray(path),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@ import * as Path from "path";
|
|||
import { createProjectSync, Project } from "@ts-morph/bootstrap";
|
||||
|
||||
export type TransformerFn = (
|
||||
program: Ts.Program
|
||||
program: Ts.Program,
|
||||
) => Ts.TransformerFactory<Ts.SourceFile>;
|
||||
|
||||
export class Transformer {
|
||||
|
@ -101,7 +101,7 @@ export class Transformer {
|
|||
|
||||
if (!file) {
|
||||
throw new Error(
|
||||
`transform must be called on Transformer with file or with string input`
|
||||
`transform must be called on Transformer with file or with string input`,
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -182,7 +182,7 @@ export interface TransformFileOptions {
|
|||
*/
|
||||
export const transformFile = (
|
||||
file: File,
|
||||
options: TransformFileOptions
|
||||
options: TransformFileOptions,
|
||||
): string => {
|
||||
const project =
|
||||
options.project ||
|
||||
|
@ -194,7 +194,7 @@ export const transformFile = (
|
|||
project.createSourceFile(file.path, file.contents);
|
||||
|
||||
(options.sources || []).forEach((source) =>
|
||||
project.createSourceFile(source.path, source.contents)
|
||||
project.createSourceFile(source.path, source.contents),
|
||||
);
|
||||
|
||||
(options.mocks || []).forEach((mock) => {
|
||||
|
@ -202,7 +202,7 @@ export const transformFile = (
|
|||
project.createSourceFile(`${base}/index.ts`, mock.content);
|
||||
project.fileSystem.writeFileSync(
|
||||
`${base}/package.json`,
|
||||
JSON.stringify({ name: mock.name, main: "./src/index.ts" })
|
||||
JSON.stringify({ name: mock.name, main: "./src/index.ts" }),
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -215,7 +215,7 @@ export const transformFile = (
|
|||
false,
|
||||
{
|
||||
before: options.transforms.map((t) => t(program)),
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
if (emitSkipped) {
|
||||
|
@ -242,7 +242,7 @@ export const transformFile = (
|
|||
};
|
||||
|
||||
export function getCompilerOptions(
|
||||
options?: Partial<Ts.CompilerOptions>
|
||||
options?: Partial<Ts.CompilerOptions>,
|
||||
): Ts.CompilerOptions {
|
||||
return {
|
||||
outDir: "/dist",
|
||||
|
@ -262,7 +262,7 @@ export function getCompilerOptions(
|
|||
|
||||
function getFileArtifactPath(
|
||||
file: Ts.SourceFile,
|
||||
program: Ts.Program
|
||||
program: Ts.Program,
|
||||
): string | undefined {
|
||||
const options = program.getCompilerOptions();
|
||||
const extname = Path.extname(file.fileName);
|
||||
|
|
|
@ -30,7 +30,7 @@ export type FunctionFieldResolver<
|
|||
source: TSource,
|
||||
args: TArgs,
|
||||
context: TContext,
|
||||
info: ResolveInfo
|
||||
info: ResolveInfo,
|
||||
) => TReturn;
|
||||
|
||||
export type FieldResolver<
|
||||
|
@ -48,7 +48,7 @@ export type FieldResolver<
|
|||
export type TypeResolver<TSource, TContext> = (
|
||||
value: TSource,
|
||||
context: TContext,
|
||||
info: ResolveInfo
|
||||
info: ResolveInfo,
|
||||
) => PromiseOrValue<Maybe<string>>;
|
||||
|
||||
export type ObjectTypeResolver<TSource = any, TContext = any, TArgs = any> = {
|
||||
|
|
|
@ -11,12 +11,12 @@ import type { PromiseOrValue } from "../jsutils/PromiseOrValue";
|
|||
*/
|
||||
export function mapAsyncIterator<T, U, R = undefined>(
|
||||
iterable: AsyncGenerator<T, R, void> | AsyncIterable<T>,
|
||||
callback: (value: T) => PromiseOrValue<U>
|
||||
callback: (value: T) => PromiseOrValue<U>,
|
||||
): AsyncGenerator<U, R, void> {
|
||||
const iterator = iterable[Symbol.asyncIterator]();
|
||||
|
||||
async function mapResult(
|
||||
result: IteratorResult<T, R>
|
||||
result: IteratorResult<T, R>,
|
||||
): Promise<IteratorResult<U, R>> {
|
||||
if (result.done) {
|
||||
return result;
|
||||
|
|
|
@ -54,7 +54,7 @@ export function getVariableValues(
|
|||
resolvers: Resolvers,
|
||||
varDefNodes: ReadonlyArray<VariableDefinitionNode>,
|
||||
inputs: { [variable: string]: unknown },
|
||||
options?: { maxErrors?: number }
|
||||
options?: { maxErrors?: number },
|
||||
): CoercedVariableValues {
|
||||
const errors = [];
|
||||
const maxErrors = options?.maxErrors;
|
||||
|
@ -66,11 +66,11 @@ export function getVariableValues(
|
|||
(error) => {
|
||||
if (maxErrors != null && errors.length >= maxErrors) {
|
||||
throw new GraphQLError(
|
||||
"Too many errors processing variables, error limit reached. Execution aborted."
|
||||
"Too many errors processing variables, error limit reached. Execution aborted.",
|
||||
);
|
||||
}
|
||||
errors.push(error);
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
if (errors.length === 0) {
|
||||
|
@ -87,7 +87,7 @@ function coerceVariableValues(
|
|||
resolvers: Resolvers,
|
||||
varDefNodes: ReadonlyArray<VariableDefinitionNode>,
|
||||
inputs: { [variable: string]: unknown },
|
||||
onError: (error: GraphQLError) => void
|
||||
onError: (error: GraphQLError) => void,
|
||||
): { [variable: string]: unknown } {
|
||||
const coercedValues: { [variable: string]: unknown } = {};
|
||||
for (const varDefNode of varDefNodes) {
|
||||
|
@ -102,8 +102,8 @@ function coerceVariableValues(
|
|||
onError(
|
||||
new GraphQLError(
|
||||
`Variable "$${varName}" expected value of type "${varTypeStr}" which cannot be used as an input type.`,
|
||||
varDefNode.type as GraphQLTypeNode
|
||||
)
|
||||
varDefNode.type as GraphQLTypeNode,
|
||||
),
|
||||
);
|
||||
continue;
|
||||
}
|
||||
|
@ -112,15 +112,15 @@ function coerceVariableValues(
|
|||
if (varDefNode.defaultValue) {
|
||||
coercedValues[varName] = valueFromAST(
|
||||
varDefNode.defaultValue as Maybe<GraphQLValueNode>,
|
||||
varType
|
||||
varType,
|
||||
);
|
||||
} else if (isNonNullType(varType)) {
|
||||
const varTypeStr = print(varDefNode.type as GraphQLTypeNode);
|
||||
onError(
|
||||
new GraphQLError(
|
||||
`Variable "$${varName}" of required type "${varTypeStr}" was not provided.`,
|
||||
varDefNode as GraphQLVariableDefinitionNode
|
||||
)
|
||||
varDefNode as GraphQLVariableDefinitionNode,
|
||||
),
|
||||
);
|
||||
}
|
||||
continue;
|
||||
|
@ -132,8 +132,8 @@ function coerceVariableValues(
|
|||
onError(
|
||||
new GraphQLError(
|
||||
`Variable "$${varName}" of non-null type "${varTypeStr}" must not be null.`,
|
||||
varDefNode as GraphQLVariableDefinitionNode
|
||||
)
|
||||
varDefNode as GraphQLVariableDefinitionNode,
|
||||
),
|
||||
);
|
||||
continue;
|
||||
}
|
||||
|
@ -154,10 +154,10 @@ function coerceVariableValues(
|
|||
undefined,
|
||||
undefined,
|
||||
undefined,
|
||||
error.originalError
|
||||
)
|
||||
error.originalError,
|
||||
),
|
||||
);
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -177,7 +177,7 @@ function coerceVariableValues(
|
|||
export function getArgumentValues(
|
||||
resolvers: Resolvers,
|
||||
node: FieldNode | DirectiveNode,
|
||||
variableValues?: Maybe<ObjMap<unknown>>
|
||||
variableValues?: Maybe<ObjMap<unknown>>,
|
||||
): { [argument: string]: unknown } {
|
||||
const coercedValues: { [argument: string]: unknown } = {};
|
||||
|
||||
|
@ -185,7 +185,7 @@ export function getArgumentValues(
|
|||
const argumentNodes = node.arguments ?? [];
|
||||
const argNodeMap = keyMap(
|
||||
argumentNodes,
|
||||
(arg: ArgumentNode) => arg.name.value
|
||||
(arg: ArgumentNode) => arg.name.value,
|
||||
);
|
||||
|
||||
for (const argumentNode of argumentNodes) {
|
||||
|
@ -197,9 +197,9 @@ export function getArgumentValues(
|
|||
console.log(argType, isInputType(argType));
|
||||
throw new GraphQLError(
|
||||
`Argument "$${name}" expected value of type "${inspect(
|
||||
argType
|
||||
argType,
|
||||
)}" which cannot be used as an input type.`,
|
||||
argumentNode as GraphQLArgumentNode
|
||||
argumentNode as GraphQLArgumentNode,
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -218,7 +218,7 @@ export function getArgumentValues(
|
|||
throw new GraphQLError(
|
||||
`Argument "${name}" of required type "${inspect(argType)}" ` +
|
||||
`was provided the variable "$${variableName}" which was not provided a runtime value.`,
|
||||
valueNode as GraphQLValueNode
|
||||
valueNode as GraphQLValueNode,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -228,7 +228,7 @@ export function getArgumentValues(
|
|||
const coercedValue = valueFromAST(
|
||||
valueNode as GraphQLValueNode,
|
||||
argType,
|
||||
variableValues
|
||||
variableValues,
|
||||
);
|
||||
if (coercedValue === undefined) {
|
||||
// Note: ValuesOfCorrectTypeRule validation should catch this before
|
||||
|
@ -236,9 +236,9 @@ export function getArgumentValues(
|
|||
// continue with an invalid argument value.
|
||||
throw new GraphQLError(
|
||||
`Argument "${name}" has invalid value ${print(
|
||||
valueNode as GraphQLValueNode
|
||||
valueNode as GraphQLValueNode,
|
||||
)}.`,
|
||||
valueNode as GraphQLValueNode
|
||||
valueNode as GraphQLValueNode,
|
||||
);
|
||||
}
|
||||
coercedValues[name] = coercedValue;
|
||||
|
@ -262,11 +262,11 @@ export function getDirectiveValues(
|
|||
directiveDef: GraphQLDirective,
|
||||
node: { directives?: ReadonlyArray<DirectiveNode> },
|
||||
resolvers: Resolvers,
|
||||
variableValues?: Maybe<ObjMap<unknown>>
|
||||
variableValues?: Maybe<ObjMap<unknown>>,
|
||||
): undefined | { [argument: string]: unknown } {
|
||||
// istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203')
|
||||
const directiveNode = node.directives?.find(
|
||||
(directive) => directive.name.value === directiveDef.name
|
||||
(directive) => directive.name.value === directiveDef.name,
|
||||
);
|
||||
|
||||
if (directiveNode) {
|
||||
|
@ -288,7 +288,7 @@ export const specifiedScalars: { [key: string]: GraphQLScalarType } = {
|
|||
|
||||
function graphqlTypeFromTypeAst(
|
||||
resolvers: Resolvers,
|
||||
node: TypeNode
|
||||
node: TypeNode,
|
||||
): GraphQLType {
|
||||
if (node.kind === Kind.NON_NULL_TYPE) {
|
||||
return new GraphQLNonNull(graphqlTypeFromTypeAst(resolvers, node.type));
|
||||
|
|
|
@ -1 +1 @@
|
|||
{}
|
||||
{}
|
||||
|
|
|
@ -69,7 +69,7 @@ describe("transformer tests", () => {
|
|||
.addTransformer((program: ts.Program) =>
|
||||
getTransformer({
|
||||
transformer: (document) => "haha, imma here, breaking your graphql",
|
||||
})
|
||||
}),
|
||||
)
|
||||
.addMock({
|
||||
name: "@graphitation/graphql-js-tag",
|
||||
|
@ -100,7 +100,7 @@ describe("transformer tests", () => {
|
|||
getTransformer({
|
||||
graphqlTagModule: "graphql-tag",
|
||||
graphqlTagModuleExport: "gql",
|
||||
})
|
||||
}),
|
||||
)
|
||||
.addMock({
|
||||
name: "graphql-tag",
|
||||
|
@ -128,7 +128,7 @@ describe("transformer tests", () => {
|
|||
.addTransformer((program: ts.Program) =>
|
||||
getTransformer({
|
||||
graphqlTagModuleExport: "default",
|
||||
})
|
||||
}),
|
||||
)
|
||||
.addMock({
|
||||
name: "@graphitation/graphql-js-tag",
|
||||
|
@ -217,7 +217,7 @@ describe("transformer tests", () => {
|
|||
.addTransformer((program: ts.Program) =>
|
||||
getTransformer({
|
||||
graphqlTagModuleExport: "default",
|
||||
})
|
||||
}),
|
||||
)
|
||||
.addMock({
|
||||
name: "@graphitation/graphql-js-tag",
|
||||
|
|
|
@ -10,14 +10,14 @@ interface GraphQLTagTransformContext {
|
|||
graphqlTagModuleRegexp: RegExp;
|
||||
graphqlTagModuleExport: string;
|
||||
transformer?: (
|
||||
node: FragmentDefinitionNode | OperationDefinitionNode
|
||||
node: FragmentDefinitionNode | OperationDefinitionNode,
|
||||
) => unknown;
|
||||
}
|
||||
export interface GraphQLTagTransformOptions {
|
||||
graphqlTagModule?: string;
|
||||
graphqlTagModuleExport?: "default" | string;
|
||||
transformer?: (
|
||||
node: FragmentDefinitionNode | OperationDefinitionNode
|
||||
node: FragmentDefinitionNode | OperationDefinitionNode,
|
||||
) => unknown;
|
||||
}
|
||||
|
||||
|
@ -27,20 +27,20 @@ const DefaultContext: GraphQLTagTransformContext = {
|
|||
};
|
||||
|
||||
export function getTransformer(
|
||||
options: Partial<GraphQLTagTransformOptions>
|
||||
options: Partial<GraphQLTagTransformOptions>,
|
||||
): ts.TransformerFactory<ts.SourceFile> {
|
||||
const transformerContext = createTransformerContext(options);
|
||||
return (context: ts.TransformationContext): ts.Transformer<ts.SourceFile> => {
|
||||
return (sourceFile: ts.SourceFile) =>
|
||||
ts.visitNode(
|
||||
sourceFile,
|
||||
getVisitor(transformerContext, context, sourceFile)
|
||||
getVisitor(transformerContext, context, sourceFile),
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
export function createTransformerContext(
|
||||
options: GraphQLTagTransformOptions
|
||||
options: GraphQLTagTransformOptions,
|
||||
): GraphQLTagTransformContext {
|
||||
const context: GraphQLTagTransformContext = {
|
||||
...DefaultContext,
|
||||
|
@ -65,14 +65,14 @@ export function createTransformerContext(
|
|||
function getVisitor(
|
||||
transformerContext: GraphQLTagTransformContext,
|
||||
context: ts.TransformationContext,
|
||||
sourceFile: ts.SourceFile
|
||||
sourceFile: ts.SourceFile,
|
||||
): ts.Visitor {
|
||||
let templateLiteralName: string | null = null;
|
||||
const visitor: ts.Visitor = (node: ts.Node): ts.VisitResult<ts.Node> => {
|
||||
// `graphql-tag` import declaration detected
|
||||
if (ts.isImportDeclaration(node)) {
|
||||
const moduleName = (node as ts.ImportDeclaration).moduleSpecifier.getText(
|
||||
sourceFile
|
||||
sourceFile,
|
||||
);
|
||||
// here we want to remove export, but only if there are no other exports. if there are other exports
|
||||
// we remove only the one we need. Logic is complex cause tag can be default or not-default export
|
||||
|
@ -91,9 +91,9 @@ function getVisitor(
|
|||
node.importClause,
|
||||
node.importClause.isTypeOnly,
|
||||
undefined,
|
||||
node.importClause.namedBindings
|
||||
node.importClause.namedBindings,
|
||||
),
|
||||
node.moduleSpecifier
|
||||
node.moduleSpecifier,
|
||||
);
|
||||
} else {
|
||||
return undefined;
|
||||
|
@ -130,9 +130,9 @@ function getVisitor(
|
|||
node.importClause.name,
|
||||
newImportSpecifiers.length
|
||||
? ts.factory.createNamedImports(newImportSpecifiers)
|
||||
: undefined
|
||||
: undefined,
|
||||
),
|
||||
node.moduleSpecifier
|
||||
node.moduleSpecifier,
|
||||
);
|
||||
return result;
|
||||
} else {
|
||||
|
@ -168,7 +168,7 @@ function getVisitor(
|
|||
|
||||
let definitions = getDefinitions(
|
||||
source,
|
||||
transformerContext.transformer
|
||||
transformerContext.transformer,
|
||||
);
|
||||
|
||||
return createDocument(definitions, interpolations);
|
||||
|
@ -183,12 +183,12 @@ function getVisitor(
|
|||
|
||||
function collectTemplateInterpolations(
|
||||
node: ts.Node,
|
||||
context: ts.TransformationContext
|
||||
context: ts.TransformationContext,
|
||||
): Array<ts.Identifier | ts.PropertyAccessExpression> {
|
||||
const interpolations: Array<ts.Identifier | ts.PropertyAccessExpression> = [];
|
||||
function collectTemplateInterpolationsImpl(
|
||||
node: ts.Node,
|
||||
context: ts.TransformationContext
|
||||
context: ts.TransformationContext,
|
||||
): ts.Node {
|
||||
if (ts.isTemplateSpan(node)) {
|
||||
const interpolation = node.getChildAt(0);
|
||||
|
@ -198,7 +198,7 @@ function collectTemplateInterpolations(
|
|||
!ts.isPropertyAccessExpression(interpolation)
|
||||
) {
|
||||
throw new Error(
|
||||
"Only identifiers or property access expressions are allowed by this transformer as an interpolation in a GraphQL template literal."
|
||||
"Only identifiers or property access expressions are allowed by this transformer as an interpolation in a GraphQL template literal.",
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -208,7 +208,7 @@ function collectTemplateInterpolations(
|
|||
return ts.visitEachChild(
|
||||
node,
|
||||
(childNode) => collectTemplateInterpolationsImpl(childNode, context),
|
||||
context
|
||||
context,
|
||||
);
|
||||
}
|
||||
collectTemplateInterpolationsImpl(node, context);
|
||||
|
@ -217,7 +217,7 @@ function collectTemplateInterpolations(
|
|||
|
||||
function getDefinitions(
|
||||
source: string,
|
||||
transformer: GraphQLTagTransformContext["transformer"] | undefined
|
||||
transformer: GraphQLTagTransformContext["transformer"] | undefined,
|
||||
): Array<unknown> {
|
||||
const queryDocument = parse(source, {
|
||||
noLocation: true,
|
||||
|
@ -228,7 +228,7 @@ function getDefinitions(
|
|||
if (definition.kind === Kind.OPERATION_DEFINITION) {
|
||||
if (queryDocument.definitions.length > 1) {
|
||||
throw new Error(
|
||||
`If a GraphQL query document contains multiple operations, each operation must be named.\n${source}`
|
||||
`If a GraphQL query document contains multiple operations, each operation must be named.\n${source}`,
|
||||
);
|
||||
}
|
||||
definitions.push(transformer ? transformer(definition) : definition);
|
||||
|
@ -242,34 +242,34 @@ function getDefinitions(
|
|||
|
||||
function createDocument(
|
||||
definitions: Array<unknown>,
|
||||
interpolations: Array<ts.Identifier | ts.PropertyAccessExpression>
|
||||
interpolations: Array<ts.Identifier | ts.PropertyAccessExpression>,
|
||||
): ts.ObjectLiteralExpression {
|
||||
const baseDefinitions = ts.factory.createArrayLiteralExpression(
|
||||
definitions.map((def) => toAst(def))
|
||||
definitions.map((def) => toAst(def)),
|
||||
);
|
||||
|
||||
const extraDefinitions = interpolations.map((expr) => {
|
||||
return ts.factory.createPropertyAccessExpression(
|
||||
expr,
|
||||
ts.factory.createIdentifier("definitions")
|
||||
ts.factory.createIdentifier("definitions"),
|
||||
);
|
||||
});
|
||||
|
||||
const allDefinitions = ts.factory.createCallExpression(
|
||||
ts.factory.createPropertyAccessExpression(
|
||||
baseDefinitions,
|
||||
ts.factory.createIdentifier("concat")
|
||||
ts.factory.createIdentifier("concat"),
|
||||
),
|
||||
undefined,
|
||||
extraDefinitions.length
|
||||
? extraDefinitions
|
||||
: [ts.factory.createArrayLiteralExpression()]
|
||||
: [ts.factory.createArrayLiteralExpression()],
|
||||
);
|
||||
|
||||
return ts.factory.createObjectLiteralExpression([
|
||||
ts.factory.createPropertyAssignment(
|
||||
"kind",
|
||||
ts.factory.createStringLiteral(Kind.DOCUMENT)
|
||||
ts.factory.createStringLiteral(Kind.DOCUMENT),
|
||||
),
|
||||
ts.factory.createPropertyAssignment("definitions", allDefinitions),
|
||||
]);
|
||||
|
@ -294,14 +294,14 @@ function toAst(literal: any): ts.Expression {
|
|||
default:
|
||||
if (Array.isArray(literal)) {
|
||||
return ts.factory.createArrayLiteralExpression(
|
||||
literal.map((item) => toAst(item))
|
||||
literal.map((item) => toAst(item)),
|
||||
);
|
||||
}
|
||||
|
||||
return ts.factory.createObjectLiteralExpression(
|
||||
Object.keys(literal).map((k) => {
|
||||
return ts.factory.createPropertyAssignment(k, toAst(literal[k]));
|
||||
})
|
||||
}),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@ import * as Path from "path";
|
|||
import { createProjectSync, Project } from "@ts-morph/bootstrap";
|
||||
|
||||
export type TransformerFn = (
|
||||
program: Ts.Program
|
||||
program: Ts.Program,
|
||||
) => Ts.TransformerFactory<Ts.SourceFile>;
|
||||
|
||||
export class Transformer {
|
||||
|
@ -101,7 +101,7 @@ export class Transformer {
|
|||
|
||||
if (!file) {
|
||||
throw new Error(
|
||||
`transform must be called on Transformer with file or with string input`
|
||||
`transform must be called on Transformer with file or with string input`,
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -182,7 +182,7 @@ export interface TransformFileOptions {
|
|||
*/
|
||||
export const transformFile = (
|
||||
file: File,
|
||||
options: TransformFileOptions
|
||||
options: TransformFileOptions,
|
||||
): string => {
|
||||
const project =
|
||||
options.project ||
|
||||
|
@ -194,7 +194,7 @@ export const transformFile = (
|
|||
project.createSourceFile(file.path, file.contents);
|
||||
|
||||
(options.sources || []).forEach((source) =>
|
||||
project.createSourceFile(source.path, source.contents)
|
||||
project.createSourceFile(source.path, source.contents),
|
||||
);
|
||||
|
||||
(options.mocks || []).forEach((mock) => {
|
||||
|
@ -202,7 +202,7 @@ export const transformFile = (
|
|||
project.createSourceFile(`${base}/index.ts`, mock.content);
|
||||
project.fileSystem.writeFileSync(
|
||||
`${base}/package.json`,
|
||||
JSON.stringify({ name: mock.name, main: "./src/index.ts" })
|
||||
JSON.stringify({ name: mock.name, main: "./src/index.ts" }),
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -215,7 +215,7 @@ export const transformFile = (
|
|||
false,
|
||||
{
|
||||
before: options.transforms.map((t) => t(program)),
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
if (emitSkipped) {
|
||||
|
@ -242,7 +242,7 @@ export const transformFile = (
|
|||
};
|
||||
|
||||
export function getCompilerOptions(
|
||||
options?: Partial<Ts.CompilerOptions>
|
||||
options?: Partial<Ts.CompilerOptions>,
|
||||
): Ts.CompilerOptions {
|
||||
return {
|
||||
outDir: "/dist",
|
||||
|
@ -262,7 +262,7 @@ export function getCompilerOptions(
|
|||
|
||||
function getFileArtifactPath(
|
||||
file: Ts.SourceFile,
|
||||
program: Ts.Program
|
||||
program: Ts.Program,
|
||||
): string | undefined {
|
||||
const options = program.getCompilerOptions();
|
||||
const extname = Path.extname(file.fileName);
|
||||
|
|
|
@ -9,7 +9,6 @@ import {
|
|||
series,
|
||||
} from "just-scripts";
|
||||
import * as path from "path";
|
||||
import * as fs from "fs";
|
||||
import * as glob from "fast-glob";
|
||||
|
||||
export const types = () => {
|
||||
|
@ -55,7 +54,7 @@ export const build = () => {
|
|||
esbuildTask({
|
||||
...baseEsbuildOptions,
|
||||
format: "cjs",
|
||||
})
|
||||
}),
|
||||
);
|
||||
};
|
||||
|
||||
|
|
|
@ -8,15 +8,17 @@
|
|||
"monorepo-scripts": "bin/monorepo-scripts.js"
|
||||
},
|
||||
"devDependencies": {
|
||||
"jest": "^26.6.3",
|
||||
"typescript": ">=4.2.3",
|
||||
"ts-jest": "^26.5.4",
|
||||
"just-scripts": "^1.5.3",
|
||||
"ts-node": "^9.1.1",
|
||||
"@typescript-eslint/eslint-plugin": "^5.10.0",
|
||||
"@typescript-eslint/parser": "^5.10.0",
|
||||
"esbuild": "^0.11.5",
|
||||
"eslint": "^7.23.0",
|
||||
"@typescript-eslint/parser": "^4.21.0",
|
||||
"@typescript-eslint/eslint-plugin": "4.7.0",
|
||||
"fast-glob": "^3.2.5"
|
||||
"eslint": "^8.7.0",
|
||||
"eslint-config-prettier": "^8.3.0",
|
||||
"eslint-plugin-prettier": "^4.0.0",
|
||||
"fast-glob": "^3.2.5",
|
||||
"jest": "^26.6.3",
|
||||
"just-scripts": "^1.5.3",
|
||||
"ts-jest": "^26.5.4",
|
||||
"ts-node": "^9.1.1",
|
||||
"typescript": ">=4.2.3"
|
||||
}
|
||||
}
|
||||
|
|
523
yarn.lock
523
yarn.lock
|
@ -126,13 +126,6 @@
|
|||
events "^3.0.0"
|
||||
tslib "^1.10.0"
|
||||
|
||||
"@babel/code-frame@7.12.11":
|
||||
version "7.12.11"
|
||||
resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.12.11.tgz#f4ad435aa263db935b8f10f2c552d23fb716a63f"
|
||||
integrity sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==
|
||||
dependencies:
|
||||
"@babel/highlight" "^7.10.4"
|
||||
|
||||
"@babel/code-frame@7.16.0", "@babel/code-frame@^7.14.5", "@babel/code-frame@^7.16.0":
|
||||
version "7.16.0"
|
||||
resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.16.0.tgz#0dfc80309beec8411e65e706461c408b0bb9b431"
|
||||
|
@ -386,7 +379,7 @@
|
|||
"@babel/traverse" "^7.13.0"
|
||||
"@babel/types" "^7.13.0"
|
||||
|
||||
"@babel/highlight@^7.10.4", "@babel/highlight@^7.12.13":
|
||||
"@babel/highlight@^7.12.13":
|
||||
version "7.13.10"
|
||||
resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.13.10.tgz#a8b2a66148f5b27d666b15d81774347a731d52d1"
|
||||
integrity sha512-5aPpe5XQPzflQrFwL1/QoeHkP2MsA4JCntcXHRhEsdsfPVkvPi2w7Qix4iV7t5S/oC9OodGrggd8aco1g3SZFg==
|
||||
|
@ -822,18 +815,18 @@
|
|||
ts-node "^9"
|
||||
tslib "^2"
|
||||
|
||||
"@eslint/eslintrc@^0.4.0":
|
||||
version "0.4.0"
|
||||
resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-0.4.0.tgz#99cc0a0584d72f1df38b900fb062ba995f395547"
|
||||
integrity sha512-2ZPCc+uNbjV5ERJr+aKSPRwZgKd2z11x0EgLvb1PURmUrn9QNRXFqje0Ldq454PfAVyaJYyrDvvIKSFP4NnBog==
|
||||
"@eslint/eslintrc@^1.0.5":
|
||||
version "1.0.5"
|
||||
resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.0.5.tgz#33f1b838dbf1f923bfa517e008362b78ddbbf318"
|
||||
integrity sha512-BLxsnmK3KyPunz5wmCCpqy0YelEoxxGmH73Is+Z74oOTMtExcjkr3dDR6quwrjh1YspA8DH9gnX1o069KiS9AQ==
|
||||
dependencies:
|
||||
ajv "^6.12.4"
|
||||
debug "^4.1.1"
|
||||
espree "^7.3.0"
|
||||
globals "^12.1.0"
|
||||
debug "^4.3.2"
|
||||
espree "^9.2.0"
|
||||
globals "^13.9.0"
|
||||
ignore "^4.0.6"
|
||||
import-fresh "^3.2.1"
|
||||
js-yaml "^3.13.1"
|
||||
js-yaml "^4.1.0"
|
||||
minimatch "^3.0.4"
|
||||
strip-json-comments "^3.1.1"
|
||||
|
||||
|
@ -1019,6 +1012,20 @@
|
|||
resolved "https://registry.yarnpkg.com/@graphql-typed-document-node/core/-/core-3.1.0.tgz#0eee6373e11418bfe0b5638f654df7a4ca6a3950"
|
||||
integrity sha512-wYn6r8zVZyQJ6rQaALBEln5B1pzxb9shV5Ef97kTvn6yVGrqyXVnDqnU24MXnFubR+rZjBY9NWuxX3FB2sTsjg==
|
||||
|
||||
"@humanwhocodes/config-array@^0.9.2":
|
||||
version "0.9.2"
|
||||
resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.9.2.tgz#68be55c737023009dfc5fe245d51181bb6476914"
|
||||
integrity sha512-UXOuFCGcwciWckOpmfKDq/GyhlTf9pN/BzG//x8p8zTOFEcGuA68ANXheFS0AGvy3qgZqLBUkMs7hqzqCKOVwA==
|
||||
dependencies:
|
||||
"@humanwhocodes/object-schema" "^1.2.1"
|
||||
debug "^4.1.1"
|
||||
minimatch "^3.0.4"
|
||||
|
||||
"@humanwhocodes/object-schema@^1.2.1":
|
||||
version "1.2.1"
|
||||
resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz#b520529ec21d8e5945a1851dfd1c32e94e39ff45"
|
||||
integrity sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==
|
||||
|
||||
"@iarna/toml@^2.2.5":
|
||||
version "2.2.5"
|
||||
resolved "https://registry.yarnpkg.com/@iarna/toml/-/toml-2.2.5.tgz#b32366c89b43c6f8cefbdefac778b9c828e3ba8c"
|
||||
|
@ -1506,10 +1513,10 @@
|
|||
jest-diff "^26.0.0"
|
||||
pretty-format "^26.0.0"
|
||||
|
||||
"@types/json-schema@^7.0.3":
|
||||
version "7.0.7"
|
||||
resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.7.tgz#98a993516c859eb0d5c4c8f098317a9ea68db9ad"
|
||||
integrity sha512-cxWFQVseBm6O9Gbw1IWb8r6OS4OhSt3hPZLkFApLjM8TEXROBuQGLAH2i2gZpcXdLBIrpXuTDhH7Vbm1iXmNGA==
|
||||
"@types/json-schema@^7.0.9":
|
||||
version "7.0.9"
|
||||
resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.9.tgz#97edc9037ea0c38585320b28964dde3b39e4660d"
|
||||
integrity sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ==
|
||||
|
||||
"@types/minimatch@*", "@types/minimatch@^3.0.3":
|
||||
version "3.0.4"
|
||||
|
@ -1644,109 +1651,85 @@
|
|||
resolved "https://registry.yarnpkg.com/@types/zen-observable/-/zen-observable-0.8.2.tgz#808c9fa7e4517274ed555fa158f2de4b4f468e71"
|
||||
integrity sha512-HrCIVMLjE1MOozVoD86622S7aunluLb2PJdPfb3nYiEtohm8mIB/vyv0Fd37AdeMFrTUQXEunw78YloMA3Qilg==
|
||||
|
||||
"@typescript-eslint/eslint-plugin@4.7.0":
|
||||
version "4.7.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.7.0.tgz#85c9bbda00c0cb604d3c241f7bc7fb171a2d3479"
|
||||
integrity sha512-li9aiSVBBd7kU5VlQlT1AqP0uWGDK6JYKUQ9cVDnOg34VNnd9t4jr0Yqc/bKxJr/tDCPDaB4KzoSFN9fgVxe/Q==
|
||||
"@typescript-eslint/eslint-plugin@^5.10.0":
|
||||
version "5.10.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.10.0.tgz#e90afea96dff8620892ad216b0e4ccdf8ee32d3a"
|
||||
integrity sha512-XXVKnMsq2fuu9K2KsIxPUGqb6xAImz8MEChClbXmE3VbveFtBUU5bzM6IPVWqzyADIgdkS2Ws/6Xo7W2TeZWjQ==
|
||||
dependencies:
|
||||
"@typescript-eslint/experimental-utils" "4.7.0"
|
||||
"@typescript-eslint/scope-manager" "4.7.0"
|
||||
debug "^4.1.1"
|
||||
"@typescript-eslint/scope-manager" "5.10.0"
|
||||
"@typescript-eslint/type-utils" "5.10.0"
|
||||
"@typescript-eslint/utils" "5.10.0"
|
||||
debug "^4.3.2"
|
||||
functional-red-black-tree "^1.0.1"
|
||||
regexpp "^3.0.0"
|
||||
semver "^7.3.2"
|
||||
tsutils "^3.17.1"
|
||||
ignore "^5.1.8"
|
||||
regexpp "^3.2.0"
|
||||
semver "^7.3.5"
|
||||
tsutils "^3.21.0"
|
||||
|
||||
"@typescript-eslint/experimental-utils@4.7.0":
|
||||
version "4.7.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-4.7.0.tgz#8d1058c38bec3d3bbd9c898a1c32318d80faf3c5"
|
||||
integrity sha512-cymzovXAiD4EF+YoHAB5Oh02MpnXjvyaOb+v+BdpY7lsJXZQN34oIETeUwVT2XfV9rSNpXaIcknDLfupO/tUoA==
|
||||
"@typescript-eslint/parser@^5.10.0":
|
||||
version "5.10.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.10.0.tgz#8f59e036f5f1cffc178cacbd5ccdd02aeb96c91c"
|
||||
integrity sha512-pJB2CCeHWtwOAeIxv8CHVGJhI5FNyJAIpx5Pt72YkK3QfEzt6qAlXZuyaBmyfOdM62qU0rbxJzNToPTVeJGrQw==
|
||||
dependencies:
|
||||
"@types/json-schema" "^7.0.3"
|
||||
"@typescript-eslint/scope-manager" "4.7.0"
|
||||
"@typescript-eslint/types" "4.7.0"
|
||||
"@typescript-eslint/typescript-estree" "4.7.0"
|
||||
eslint-scope "^5.0.0"
|
||||
eslint-utils "^2.0.0"
|
||||
"@typescript-eslint/scope-manager" "5.10.0"
|
||||
"@typescript-eslint/types" "5.10.0"
|
||||
"@typescript-eslint/typescript-estree" "5.10.0"
|
||||
debug "^4.3.2"
|
||||
|
||||
"@typescript-eslint/parser@^4.21.0":
|
||||
version "4.21.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-4.21.0.tgz#a227fc2af4001668c3e3f7415d4feee5093894c1"
|
||||
integrity sha512-eyNf7QmE5O/l1smaQgN0Lj2M/1jOuNg2NrBm1dqqQN0sVngTLyw8tdCbih96ixlhbF1oINoN8fDCyEH9SjLeIA==
|
||||
"@typescript-eslint/scope-manager@5.10.0":
|
||||
version "5.10.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.10.0.tgz#bb5d872e8b9e36203908595507fbc4d3105329cb"
|
||||
integrity sha512-tgNgUgb4MhqK6DoKn3RBhyZ9aJga7EQrw+2/OiDk5hKf3pTVZWyqBi7ukP+Z0iEEDMF5FDa64LqODzlfE4O/Dg==
|
||||
dependencies:
|
||||
"@typescript-eslint/scope-manager" "4.21.0"
|
||||
"@typescript-eslint/types" "4.21.0"
|
||||
"@typescript-eslint/typescript-estree" "4.21.0"
|
||||
debug "^4.1.1"
|
||||
"@typescript-eslint/types" "5.10.0"
|
||||
"@typescript-eslint/visitor-keys" "5.10.0"
|
||||
|
||||
"@typescript-eslint/scope-manager@4.21.0":
|
||||
version "4.21.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.21.0.tgz#c81b661c4b8af1ec0c010d847a8f9ab76ab95b4d"
|
||||
integrity sha512-kfOjF0w1Ix7+a5T1knOw00f7uAP9Gx44+OEsNQi0PvvTPLYeXJlsCJ4tYnDj5PQEYfpcgOH5yBlw7K+UEI9Agw==
|
||||
"@typescript-eslint/type-utils@5.10.0":
|
||||
version "5.10.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.10.0.tgz#8524b9479c19c478347a7df216827e749e4a51e5"
|
||||
integrity sha512-TzlyTmufJO5V886N+hTJBGIfnjQDQ32rJYxPaeiyWKdjsv2Ld5l8cbS7pxim4DeNs62fKzRSt8Q14Evs4JnZyQ==
|
||||
dependencies:
|
||||
"@typescript-eslint/types" "4.21.0"
|
||||
"@typescript-eslint/visitor-keys" "4.21.0"
|
||||
"@typescript-eslint/utils" "5.10.0"
|
||||
debug "^4.3.2"
|
||||
tsutils "^3.21.0"
|
||||
|
||||
"@typescript-eslint/scope-manager@4.7.0":
|
||||
version "4.7.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.7.0.tgz#2115526085fb72723ccdc1eeae75dec7126220ed"
|
||||
integrity sha512-ILITvqwDJYbcDCROj6+Ob0oCKNg3SH46iWcNcTIT9B5aiVssoTYkhKjxOMNzR1F7WSJkik4zmuqve5MdnA0DyA==
|
||||
"@typescript-eslint/types@5.10.0":
|
||||
version "5.10.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.10.0.tgz#beb3cb345076f5b088afe996d57bcd1dfddaa75c"
|
||||
integrity sha512-wUljCgkqHsMZbw60IbOqT/puLfyqqD5PquGiBo1u1IS3PLxdi3RDGlyf032IJyh+eQoGhz9kzhtZa+VC4eWTlQ==
|
||||
|
||||
"@typescript-eslint/typescript-estree@5.10.0":
|
||||
version "5.10.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.10.0.tgz#4be24a3dea0f930bb1397c46187d0efdd955a224"
|
||||
integrity sha512-x+7e5IqfwLwsxTdliHRtlIYkgdtYXzE0CkFeV6ytAqq431ZyxCFzNMNR5sr3WOlIG/ihVZr9K/y71VHTF/DUQA==
|
||||
dependencies:
|
||||
"@typescript-eslint/types" "4.7.0"
|
||||
"@typescript-eslint/visitor-keys" "4.7.0"
|
||||
"@typescript-eslint/types" "5.10.0"
|
||||
"@typescript-eslint/visitor-keys" "5.10.0"
|
||||
debug "^4.3.2"
|
||||
globby "^11.0.4"
|
||||
is-glob "^4.0.3"
|
||||
semver "^7.3.5"
|
||||
tsutils "^3.21.0"
|
||||
|
||||
"@typescript-eslint/types@4.21.0":
|
||||
version "4.21.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.21.0.tgz#abdc3463bda5d31156984fa5bc316789c960edef"
|
||||
integrity sha512-+OQaupjGVVc8iXbt6M1oZMwyKQNehAfLYJJ3SdvnofK2qcjfor9pEM62rVjBknhowTkh+2HF+/KdRAc/wGBN2w==
|
||||
|
||||
"@typescript-eslint/types@4.7.0":
|
||||
version "4.7.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.7.0.tgz#5e95ef5c740f43d942542b35811f87b62fccca69"
|
||||
integrity sha512-uLszFe0wExJc+I7q0Z/+BnP7wao/kzX0hB5vJn4LIgrfrMLgnB2UXoReV19lkJQS1a1mHWGGODSxnBx6JQC3Sg==
|
||||
|
||||
"@typescript-eslint/typescript-estree@4.21.0":
|
||||
version "4.21.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.21.0.tgz#3817bd91857beeaeff90f69f1f112ea58d350b0a"
|
||||
integrity sha512-ZD3M7yLaVGVYLw4nkkoGKumb7Rog7QID9YOWobFDMQKNl+vPxqVIW/uDk+MDeGc+OHcoG2nJ2HphwiPNajKw3w==
|
||||
"@typescript-eslint/utils@5.10.0":
|
||||
version "5.10.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.10.0.tgz#c3d152a85da77c400e37281355561c72fb1b5a65"
|
||||
integrity sha512-IGYwlt1CVcFoE2ueW4/ioEwybR60RAdGeiJX/iDAw0t5w0wK3S7QncDwpmsM70nKgGTuVchEWB8lwZwHqPAWRg==
|
||||
dependencies:
|
||||
"@typescript-eslint/types" "4.21.0"
|
||||
"@typescript-eslint/visitor-keys" "4.21.0"
|
||||
debug "^4.1.1"
|
||||
globby "^11.0.1"
|
||||
is-glob "^4.0.1"
|
||||
semver "^7.3.2"
|
||||
tsutils "^3.17.1"
|
||||
"@types/json-schema" "^7.0.9"
|
||||
"@typescript-eslint/scope-manager" "5.10.0"
|
||||
"@typescript-eslint/types" "5.10.0"
|
||||
"@typescript-eslint/typescript-estree" "5.10.0"
|
||||
eslint-scope "^5.1.1"
|
||||
eslint-utils "^3.0.0"
|
||||
|
||||
"@typescript-eslint/typescript-estree@4.7.0":
|
||||
version "4.7.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.7.0.tgz#539531167f05ba20eb0b6785567076679e29d393"
|
||||
integrity sha512-5XZRQznD1MfUmxu1t8/j2Af4OxbA7EFU2rbo0No7meb46eHgGkSieFdfV6omiC/DGIBhH9H9gXn7okBbVOm8jw==
|
||||
"@typescript-eslint/visitor-keys@5.10.0":
|
||||
version "5.10.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.10.0.tgz#770215497ad67cd15a572b52089991d5dfe06281"
|
||||
integrity sha512-GMxj0K1uyrFLPKASLmZzCuSddmjZVbVj3Ouy5QVuIGKZopxvOr24JsS7gruz6C3GExE01mublZ3mIBOaon9zuQ==
|
||||
dependencies:
|
||||
"@typescript-eslint/types" "4.7.0"
|
||||
"@typescript-eslint/visitor-keys" "4.7.0"
|
||||
debug "^4.1.1"
|
||||
globby "^11.0.1"
|
||||
is-glob "^4.0.1"
|
||||
lodash "^4.17.15"
|
||||
semver "^7.3.2"
|
||||
tsutils "^3.17.1"
|
||||
|
||||
"@typescript-eslint/visitor-keys@4.21.0":
|
||||
version "4.21.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.21.0.tgz#990a9acdc124331f5863c2cf21c88ba65233cd8d"
|
||||
integrity sha512-dH22dROWGi5Z6p+Igc8bLVLmwy7vEe8r+8c+raPQU0LxgogPUrRAtRGtvBWmlr9waTu3n+QLt/qrS/hWzk1x5w==
|
||||
dependencies:
|
||||
"@typescript-eslint/types" "4.21.0"
|
||||
eslint-visitor-keys "^2.0.0"
|
||||
|
||||
"@typescript-eslint/visitor-keys@4.7.0":
|
||||
version "4.7.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.7.0.tgz#6783824f22acfc49e754970ed21b88ac03b80e6f"
|
||||
integrity sha512-aDJDWuCRsf1lXOtignlfiPODkzSxxop7D0rZ91L6ZuMlcMCSh0YyK+gAfo5zN/ih6WxMwhoXgJWC3cWQdaKC+A==
|
||||
dependencies:
|
||||
"@typescript-eslint/types" "4.7.0"
|
||||
eslint-visitor-keys "^2.0.0"
|
||||
"@typescript-eslint/types" "5.10.0"
|
||||
eslint-visitor-keys "^3.0.0"
|
||||
|
||||
"@wry/context@^0.6.0":
|
||||
version "0.6.0"
|
||||
|
@ -1813,7 +1796,7 @@ acorn-walk@^7.1.1:
|
|||
resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-7.2.0.tgz#0de889a601203909b0fbe07b8938dc21d2e967bc"
|
||||
integrity sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA==
|
||||
|
||||
acorn@^7.1.1, acorn@^7.4.0:
|
||||
acorn@^7.1.1:
|
||||
version "7.4.1"
|
||||
resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa"
|
||||
integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==
|
||||
|
@ -1823,6 +1806,11 @@ acorn@^8.1.0:
|
|||
resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.1.0.tgz#52311fd7037ae119cbb134309e901aa46295b3fe"
|
||||
integrity sha512-LWCF/Wn0nfHOmJ9rzQApGnxnvgfROzGilS8936rqN/lfcYkY9MYZzdMqN+2NJ4SlTc+m5HiSa+kNfDtI64dwUA==
|
||||
|
||||
acorn@^8.7.0:
|
||||
version "8.7.0"
|
||||
resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.7.0.tgz#90951fde0f8f09df93549481e5fc141445b791cf"
|
||||
integrity sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==
|
||||
|
||||
ajv@^6.10.0, ajv@^6.11.0, ajv@^6.12.3, ajv@^6.12.4:
|
||||
version "6.12.6"
|
||||
resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4"
|
||||
|
@ -1833,21 +1821,6 @@ ajv@^6.10.0, ajv@^6.11.0, ajv@^6.12.3, ajv@^6.12.4:
|
|||
json-schema-traverse "^0.4.1"
|
||||
uri-js "^4.2.2"
|
||||
|
||||
ajv@^8.0.1:
|
||||
version "8.0.5"
|
||||
resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.0.5.tgz#f07d6fdeffcdbb80485570ce3f1bc845fcc812b9"
|
||||
integrity sha512-RkiLa/AeJx7+9OvniQ/qeWu0w74A8DiPPBclQ6ji3ZQkv5KamO+QGpqmi7O4JIw3rHGUXZ6CoP9tsAkn3gyazg==
|
||||
dependencies:
|
||||
fast-deep-equal "^3.1.1"
|
||||
json-schema-traverse "^1.0.0"
|
||||
require-from-string "^2.0.2"
|
||||
uri-js "^4.2.2"
|
||||
|
||||
ansi-colors@^4.1.1:
|
||||
version "4.1.1"
|
||||
resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348"
|
||||
integrity sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==
|
||||
|
||||
ansi-escapes@^4.2.1, ansi-escapes@^4.3.1:
|
||||
version "4.3.2"
|
||||
resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.2.tgz#6b2291d1db7d98b6521d5f1efa42d0f3a9feb65e"
|
||||
|
@ -1870,6 +1843,11 @@ ansi-regex@^5.0.0:
|
|||
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.0.tgz#388539f55179bf39339c81af30a654d69f87cb75"
|
||||
integrity sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==
|
||||
|
||||
ansi-regex@^5.0.1:
|
||||
version "5.0.1"
|
||||
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304"
|
||||
integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==
|
||||
|
||||
ansi-styles@^3.2.1:
|
||||
version "3.2.1"
|
||||
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d"
|
||||
|
@ -2041,11 +2019,6 @@ assign-symbols@^1.0.0:
|
|||
resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367"
|
||||
integrity sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=
|
||||
|
||||
astral-regex@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-2.0.0.tgz#483143c567aeed4785759c0865786dc77d7d2e31"
|
||||
integrity sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==
|
||||
|
||||
async-done@^1.2.0, async-done@^1.2.2:
|
||||
version "1.3.2"
|
||||
resolved "https://registry.yarnpkg.com/async-done/-/async-done-1.3.2.tgz#5e15aa729962a4b07414f528a88cdf18e0b290a2"
|
||||
|
@ -2898,13 +2871,20 @@ debug@^2.2.0, debug@^2.3.3:
|
|||
dependencies:
|
||||
ms "2.0.0"
|
||||
|
||||
debug@^4.0.1, debug@^4.1.0, debug@^4.1.1:
|
||||
debug@^4.1.0, debug@^4.1.1:
|
||||
version "4.3.1"
|
||||
resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.1.tgz#f0d229c505e0c6d8c49ac553d1b13dc183f6b2ee"
|
||||
integrity sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==
|
||||
dependencies:
|
||||
ms "2.1.2"
|
||||
|
||||
debug@^4.3.2:
|
||||
version "4.3.3"
|
||||
resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.3.tgz#04266e0b70a98d4462e6e288e38259213332b664"
|
||||
integrity sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==
|
||||
dependencies:
|
||||
ms "2.1.2"
|
||||
|
||||
decamelize@^1.2.0:
|
||||
version "1.2.0"
|
||||
resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290"
|
||||
|
@ -3055,13 +3035,6 @@ end-of-stream@^1.1.0, end-of-stream@^1.4.1:
|
|||
dependencies:
|
||||
once "^1.4.0"
|
||||
|
||||
enquirer@^2.3.5:
|
||||
version "2.3.6"
|
||||
resolved "https://registry.yarnpkg.com/enquirer/-/enquirer-2.3.6.tgz#2a7fe5dd634a1e4125a975ec994ff5456dc3734d"
|
||||
integrity sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==
|
||||
dependencies:
|
||||
ansi-colors "^4.1.1"
|
||||
|
||||
error-ex@^1.3.1:
|
||||
version "1.3.2"
|
||||
resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf"
|
||||
|
@ -3125,6 +3098,11 @@ escape-string-regexp@^2.0.0:
|
|||
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz#a30304e99daa32e23b2fd20f51babd07cffca344"
|
||||
integrity sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==
|
||||
|
||||
escape-string-regexp@^4.0.0:
|
||||
version "4.0.0"
|
||||
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34"
|
||||
integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==
|
||||
|
||||
escodegen@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-2.0.0.tgz#5e32b12833e8aa8fa35e1bf0befa89380484c7dd"
|
||||
|
@ -3137,7 +3115,19 @@ escodegen@^2.0.0:
|
|||
optionalDependencies:
|
||||
source-map "~0.6.1"
|
||||
|
||||
eslint-scope@^5.0.0, eslint-scope@^5.1.1:
|
||||
eslint-config-prettier@^8.3.0:
|
||||
version "8.3.0"
|
||||
resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.3.0.tgz#f7471b20b6fe8a9a9254cc684454202886a2dd7a"
|
||||
integrity sha512-BgZuLUSeKzvlL/VUjx/Yb787VQ26RU3gGjA3iiFvdsp/2bMfVIWUVP7tjxtjS0e+HP409cPlPvNkQloz8C91ew==
|
||||
|
||||
eslint-plugin-prettier@^4.0.0:
|
||||
version "4.0.0"
|
||||
resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-4.0.0.tgz#8b99d1e4b8b24a762472b4567992023619cb98e0"
|
||||
integrity sha512-98MqmCJ7vJodoQK359bqQWaxOE0CS8paAz/GgjaZLyex4TTk3g9HugoO89EqWCrFiOqn9EVvcoo7gZzONCWVwQ==
|
||||
dependencies:
|
||||
prettier-linter-helpers "^1.0.0"
|
||||
|
||||
eslint-scope@^5.1.1:
|
||||
version "5.1.1"
|
||||
resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c"
|
||||
integrity sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==
|
||||
|
@ -3145,74 +3135,80 @@ eslint-scope@^5.0.0, eslint-scope@^5.1.1:
|
|||
esrecurse "^4.3.0"
|
||||
estraverse "^4.1.1"
|
||||
|
||||
eslint-utils@^2.0.0, eslint-utils@^2.1.0:
|
||||
version "2.1.0"
|
||||
resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-2.1.0.tgz#d2de5e03424e707dc10c74068ddedae708741b27"
|
||||
integrity sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==
|
||||
eslint-scope@^7.1.0:
|
||||
version "7.1.0"
|
||||
resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-7.1.0.tgz#c1f6ea30ac583031f203d65c73e723b01298f153"
|
||||
integrity sha512-aWwkhnS0qAXqNOgKOK0dJ2nvzEbhEvpy8OlJ9kZ0FeZnA6zpjv1/Vei+puGFFX7zkPCkHHXb7IDX3A+7yPrRWg==
|
||||
dependencies:
|
||||
eslint-visitor-keys "^1.1.0"
|
||||
esrecurse "^4.3.0"
|
||||
estraverse "^5.2.0"
|
||||
|
||||
eslint-visitor-keys@^1.1.0, eslint-visitor-keys@^1.3.0:
|
||||
version "1.3.0"
|
||||
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz#30ebd1ef7c2fdff01c3a4f151044af25fab0523e"
|
||||
integrity sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==
|
||||
eslint-utils@^3.0.0:
|
||||
version "3.0.0"
|
||||
resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-3.0.0.tgz#8aebaface7345bb33559db0a1f13a1d2d48c3672"
|
||||
integrity sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==
|
||||
dependencies:
|
||||
eslint-visitor-keys "^2.0.0"
|
||||
|
||||
eslint-visitor-keys@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.0.0.tgz#21fdc8fbcd9c795cc0321f0563702095751511a8"
|
||||
integrity sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ==
|
||||
|
||||
eslint@^7.23.0:
|
||||
version "7.23.0"
|
||||
resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.23.0.tgz#8d029d252f6e8cf45894b4bee08f5493f8e94325"
|
||||
integrity sha512-kqvNVbdkjzpFy0XOszNwjkKzZ+6TcwCQ/h+ozlcIWwaimBBuhlQ4nN6kbiM2L+OjDcznkTJxzYfRFH92sx4a0Q==
|
||||
eslint-visitor-keys@^3.0.0, eslint-visitor-keys@^3.1.0, eslint-visitor-keys@^3.2.0:
|
||||
version "3.2.0"
|
||||
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.2.0.tgz#6fbb166a6798ee5991358bc2daa1ba76cc1254a1"
|
||||
integrity sha512-IOzT0X126zn7ALX0dwFiUQEdsfzrm4+ISsQS8nukaJXwEyYKRSnEIIDULYg1mCtGp7UUXgfGl7BIolXREQK+XQ==
|
||||
|
||||
eslint@^8.7.0:
|
||||
version "8.7.0"
|
||||
resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.7.0.tgz#22e036842ee5b7cf87b03fe237731675b4d3633c"
|
||||
integrity sha512-ifHYzkBGrzS2iDU7KjhCAVMGCvF6M3Xfs8X8b37cgrUlDt6bWRTpRh6T/gtSXv1HJ/BUGgmjvNvOEGu85Iif7w==
|
||||
dependencies:
|
||||
"@babel/code-frame" "7.12.11"
|
||||
"@eslint/eslintrc" "^0.4.0"
|
||||
"@eslint/eslintrc" "^1.0.5"
|
||||
"@humanwhocodes/config-array" "^0.9.2"
|
||||
ajv "^6.10.0"
|
||||
chalk "^4.0.0"
|
||||
cross-spawn "^7.0.2"
|
||||
debug "^4.0.1"
|
||||
debug "^4.3.2"
|
||||
doctrine "^3.0.0"
|
||||
enquirer "^2.3.5"
|
||||
eslint-scope "^5.1.1"
|
||||
eslint-utils "^2.1.0"
|
||||
eslint-visitor-keys "^2.0.0"
|
||||
espree "^7.3.1"
|
||||
escape-string-regexp "^4.0.0"
|
||||
eslint-scope "^7.1.0"
|
||||
eslint-utils "^3.0.0"
|
||||
eslint-visitor-keys "^3.2.0"
|
||||
espree "^9.3.0"
|
||||
esquery "^1.4.0"
|
||||
esutils "^2.0.2"
|
||||
fast-deep-equal "^3.1.3"
|
||||
file-entry-cache "^6.0.1"
|
||||
functional-red-black-tree "^1.0.1"
|
||||
glob-parent "^5.0.0"
|
||||
glob-parent "^6.0.1"
|
||||
globals "^13.6.0"
|
||||
ignore "^4.0.6"
|
||||
ignore "^5.2.0"
|
||||
import-fresh "^3.0.0"
|
||||
imurmurhash "^0.1.4"
|
||||
is-glob "^4.0.0"
|
||||
js-yaml "^3.13.1"
|
||||
js-yaml "^4.1.0"
|
||||
json-stable-stringify-without-jsonify "^1.0.1"
|
||||
levn "^0.4.1"
|
||||
lodash "^4.17.21"
|
||||
lodash.merge "^4.6.2"
|
||||
minimatch "^3.0.4"
|
||||
natural-compare "^1.4.0"
|
||||
optionator "^0.9.1"
|
||||
progress "^2.0.0"
|
||||
regexpp "^3.1.0"
|
||||
semver "^7.2.1"
|
||||
strip-ansi "^6.0.0"
|
||||
regexpp "^3.2.0"
|
||||
strip-ansi "^6.0.1"
|
||||
strip-json-comments "^3.1.0"
|
||||
table "^6.0.4"
|
||||
text-table "^0.2.0"
|
||||
v8-compile-cache "^2.0.3"
|
||||
|
||||
espree@^7.3.0, espree@^7.3.1:
|
||||
version "7.3.1"
|
||||
resolved "https://registry.yarnpkg.com/espree/-/espree-7.3.1.tgz#f2df330b752c6f55019f8bd89b7660039c1bbbb6"
|
||||
integrity sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==
|
||||
espree@^9.2.0, espree@^9.3.0:
|
||||
version "9.3.0"
|
||||
resolved "https://registry.yarnpkg.com/espree/-/espree-9.3.0.tgz#c1240d79183b72aaee6ccfa5a90bc9111df085a8"
|
||||
integrity sha512-d/5nCsb0JcqsSEeQzFZ8DH1RmxPcglRWh24EFTlUEmCKoehXGdpsx0RkHDubqUI8LSAIKMQp4r9SzQ3n+sm4HQ==
|
||||
dependencies:
|
||||
acorn "^7.4.0"
|
||||
acorn "^8.7.0"
|
||||
acorn-jsx "^5.3.1"
|
||||
eslint-visitor-keys "^1.3.0"
|
||||
eslint-visitor-keys "^3.1.0"
|
||||
|
||||
esprima@^4.0.0, esprima@^4.0.1, esprima@~4.0.0:
|
||||
version "4.0.1"
|
||||
|
@ -3382,11 +3378,16 @@ extsprintf@^1.2.0:
|
|||
resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f"
|
||||
integrity sha1-4mifjzVvrWLMplo6kcXfX5VRaS8=
|
||||
|
||||
fast-deep-equal@^3.1.1:
|
||||
fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3:
|
||||
version "3.1.3"
|
||||
resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525"
|
||||
integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==
|
||||
|
||||
fast-diff@^1.1.2:
|
||||
version "1.2.0"
|
||||
resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.2.0.tgz#73ee11982d86caaf7959828d519cfe927fac5f03"
|
||||
integrity sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==
|
||||
|
||||
fast-glob@^3.1.0, fast-glob@^3.2.7:
|
||||
version "3.2.7"
|
||||
resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.7.tgz#fd6cb7a2d7e9aa7a7846111e85a196d6b2f766a1"
|
||||
|
@ -3410,6 +3411,17 @@ fast-glob@^3.1.1, fast-glob@^3.2.2, fast-glob@^3.2.5:
|
|||
micromatch "^4.0.2"
|
||||
picomatch "^2.2.1"
|
||||
|
||||
fast-glob@^3.2.9:
|
||||
version "3.2.11"
|
||||
resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.11.tgz#a1172ad95ceb8a16e20caa5c5e56480e5129c1d9"
|
||||
integrity sha512-xrO3+1bxSo3ZVHAnqzyuewYT6aMFHRAd4Kcs92MAonjwQZLsK9d0SF1IyQ3k5PoirxTW0Oe/RqFgMQ6TcNE5Ew==
|
||||
dependencies:
|
||||
"@nodelib/fs.stat" "^2.0.2"
|
||||
"@nodelib/fs.walk" "^1.2.3"
|
||||
glob-parent "^5.1.2"
|
||||
merge2 "^1.3.0"
|
||||
micromatch "^4.0.4"
|
||||
|
||||
fast-json-stable-stringify@2.x, fast-json-stable-stringify@^2.0.0:
|
||||
version "2.1.0"
|
||||
resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633"
|
||||
|
@ -3778,13 +3790,20 @@ glob-parent@^3.1.0:
|
|||
is-glob "^3.1.0"
|
||||
path-dirname "^1.0.0"
|
||||
|
||||
glob-parent@^5.0.0, glob-parent@^5.1.0, glob-parent@^5.1.2, glob-parent@~5.1.0:
|
||||
glob-parent@^5.1.0, glob-parent@^5.1.2, glob-parent@~5.1.0:
|
||||
version "5.1.2"
|
||||
resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4"
|
||||
integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==
|
||||
dependencies:
|
||||
is-glob "^4.0.1"
|
||||
|
||||
glob-parent@^6.0.1:
|
||||
version "6.0.2"
|
||||
resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-6.0.2.tgz#6d237d99083950c79290f24c7642a3de9a28f9e3"
|
||||
integrity sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==
|
||||
dependencies:
|
||||
is-glob "^4.0.3"
|
||||
|
||||
glob-watcher@^5.0.5:
|
||||
version "5.0.5"
|
||||
resolved "https://registry.yarnpkg.com/glob-watcher/-/glob-watcher-5.0.5.tgz#aa6bce648332924d9a8489be41e3e5c52d4186dc"
|
||||
|
@ -3815,13 +3834,6 @@ globals@^11.1.0:
|
|||
resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e"
|
||||
integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==
|
||||
|
||||
globals@^12.1.0:
|
||||
version "12.4.0"
|
||||
resolved "https://registry.yarnpkg.com/globals/-/globals-12.4.0.tgz#a18813576a41b00a24a97e7f815918c2e19925f8"
|
||||
integrity sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==
|
||||
dependencies:
|
||||
type-fest "^0.8.1"
|
||||
|
||||
globals@^13.6.0:
|
||||
version "13.7.0"
|
||||
resolved "https://registry.yarnpkg.com/globals/-/globals-13.7.0.tgz#aed3bcefd80ad3ec0f0be2cf0c895110c0591795"
|
||||
|
@ -3829,7 +3841,14 @@ globals@^13.6.0:
|
|||
dependencies:
|
||||
type-fest "^0.20.2"
|
||||
|
||||
globby@^11.0.0, globby@^11.0.1:
|
||||
globals@^13.9.0:
|
||||
version "13.12.0"
|
||||
resolved "https://registry.yarnpkg.com/globals/-/globals-13.12.0.tgz#4d733760304230a0082ed96e21e5c565f898089e"
|
||||
integrity sha512-uS8X6lSKN2JumVoXrbUz+uG4BYG+eiawqm3qFcT7ammfbUHeCBoJMlHcec/S3krSk73/AE/f0szYFmgAA3kYZg==
|
||||
dependencies:
|
||||
type-fest "^0.20.2"
|
||||
|
||||
globby@^11.0.0:
|
||||
version "11.0.3"
|
||||
resolved "https://registry.yarnpkg.com/globby/-/globby-11.0.3.tgz#9b1f0cb523e171dd1ad8c7b2a9fb4b644b9593cb"
|
||||
integrity sha512-ffdmosjA807y7+lA1NM0jELARVmYul/715xiILEjo3hBLPTcirgQNnXECn5g3mtR8TOLCVbkfua1Hpen25/Xcg==
|
||||
|
@ -3853,6 +3872,18 @@ globby@^11.0.3:
|
|||
merge2 "^1.3.0"
|
||||
slash "^3.0.0"
|
||||
|
||||
globby@^11.0.4:
|
||||
version "11.1.0"
|
||||
resolved "https://registry.yarnpkg.com/globby/-/globby-11.1.0.tgz#bd4be98bb042f83d796f7e3811991fbe82a0d34b"
|
||||
integrity sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==
|
||||
dependencies:
|
||||
array-union "^2.1.0"
|
||||
dir-glob "^3.0.1"
|
||||
fast-glob "^3.2.9"
|
||||
ignore "^5.2.0"
|
||||
merge2 "^1.4.1"
|
||||
slash "^3.0.0"
|
||||
|
||||
graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.4:
|
||||
version "4.2.6"
|
||||
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.6.tgz#ff040b2b0853b23c3d31027523706f1885d76bee"
|
||||
|
@ -4081,6 +4112,11 @@ ignore@^5.1.4:
|
|||
resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.1.8.tgz#f150a8b50a34289b33e22f5889abd4d8016f0e57"
|
||||
integrity sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==
|
||||
|
||||
ignore@^5.1.8, ignore@^5.2.0:
|
||||
version "5.2.0"
|
||||
resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.0.tgz#6d3bac8fa7fe0d45d9f9be7bac2fc279577e345a"
|
||||
integrity sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==
|
||||
|
||||
immutable@~3.7.6:
|
||||
version "3.7.6"
|
||||
resolved "https://registry.yarnpkg.com/immutable/-/immutable-3.7.6.tgz#13b4d3cb12befa15482a26fe1b2ebae640071e4b"
|
||||
|
@ -4178,13 +4214,6 @@ is-binary-path@~2.1.0:
|
|||
dependencies:
|
||||
binary-extensions "^2.0.0"
|
||||
|
||||
is-boolean-object@^1.1.0:
|
||||
version "1.1.0"
|
||||
resolved "https://registry.yarnpkg.com/is-boolean-object/-/is-boolean-object-1.1.0.tgz#e2aaad3a3a8fca34c28f6eee135b156ed2587ff0"
|
||||
integrity sha512-a7Uprx8UtD+HWdyYwnD1+ExtTgqQtD2k/1yJgtXP6wnMm8byhkoTZRl+95LLThpzNZJ5aEvi46cdH+ayMFRwmA==
|
||||
dependencies:
|
||||
call-bind "^1.0.0"
|
||||
|
||||
is-buffer@^1.1.5:
|
||||
version "1.1.6"
|
||||
resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be"
|
||||
|
@ -4294,16 +4323,18 @@ is-glob@^4.0.0, is-glob@^4.0.1, is-glob@~4.0.1:
|
|||
dependencies:
|
||||
is-extglob "^2.1.1"
|
||||
|
||||
is-glob@^4.0.3:
|
||||
version "4.0.3"
|
||||
resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084"
|
||||
integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==
|
||||
dependencies:
|
||||
is-extglob "^2.1.1"
|
||||
|
||||
is-negated-glob@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/is-negated-glob/-/is-negated-glob-1.0.0.tgz#6910bca5da8c95e784b5751b976cf5a10fee36d2"
|
||||
integrity sha1-aRC8pdqMleeEtXUbl2z1oQ/uNtI=
|
||||
|
||||
is-number-object@^1.0.4:
|
||||
version "1.0.4"
|
||||
resolved "https://registry.yarnpkg.com/is-number-object/-/is-number-object-1.0.4.tgz#36ac95e741cf18b283fc1ddf5e83da798e3ec197"
|
||||
integrity sha512-zohwelOAur+5uXtk8O3GPQ1eAcu4ZX3UwxQhUlfFFMNpUd83gXgjbhJh6HmB6LUNV/ieOLQuDwJO3dWJosUeMw==
|
||||
|
||||
is-number@^3.0.0:
|
||||
version "3.0.0"
|
||||
resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195"
|
||||
|
@ -4362,11 +4393,6 @@ is-stream@^2.0.0:
|
|||
resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.0.tgz#bde9c32680d6fae04129d6ac9d921ce7815f78e3"
|
||||
integrity sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==
|
||||
|
||||
is-string@^1.0.5:
|
||||
version "1.0.5"
|
||||
resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.0.5.tgz#40493ed198ef3ff477b8c7f92f644ec82a5cd3a6"
|
||||
integrity sha512-buY6VNRjhQMiF1qWDouloZlQbRhDPCebwxSjxMjxgemYT46YMd2NR0/H+fBhEfWX4A/w9TBJ+ol+okqJKFE6vQ==
|
||||
|
||||
is-typedarray@^1.0.0, is-typedarray@~1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a"
|
||||
|
@ -4872,6 +4898,13 @@ js-yaml@^4.0.0:
|
|||
dependencies:
|
||||
argparse "^2.0.1"
|
||||
|
||||
js-yaml@^4.1.0:
|
||||
version "4.1.0"
|
||||
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602"
|
||||
integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==
|
||||
dependencies:
|
||||
argparse "^2.0.1"
|
||||
|
||||
jsbn@~0.1.0:
|
||||
version "0.1.1"
|
||||
resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513"
|
||||
|
@ -4924,11 +4957,6 @@ json-schema-traverse@^0.4.1:
|
|||
resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660"
|
||||
integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==
|
||||
|
||||
json-schema-traverse@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz#ae7bcb3656ab77a73ba5c49bf654f38e6b6860e2"
|
||||
integrity sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==
|
||||
|
||||
json-schema@0.2.3:
|
||||
version "0.2.3"
|
||||
resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13"
|
||||
|
@ -5141,16 +5169,6 @@ locate-path@^6.0.0:
|
|||
dependencies:
|
||||
p-locate "^5.0.0"
|
||||
|
||||
lodash.clonedeep@^4.5.0:
|
||||
version "4.5.0"
|
||||
resolved "https://registry.yarnpkg.com/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz#e23f3f9c4f8fbdde872529c1071857a086e5ccef"
|
||||
integrity sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=
|
||||
|
||||
lodash.flatten@^4.4.0:
|
||||
version "4.4.0"
|
||||
resolved "https://registry.yarnpkg.com/lodash.flatten/-/lodash.flatten-4.4.0.tgz#f31c22225a9632d2bbf8e4addbef240aa765a61f"
|
||||
integrity sha1-8xwiIlqWMtK7+OSt2+8kCqdlph8=
|
||||
|
||||
lodash.get@^4, lodash.get@^4.0.0:
|
||||
version "4.4.2"
|
||||
resolved "https://registry.yarnpkg.com/lodash.get/-/lodash.get-4.4.2.tgz#2d177f652fa31e939b4438d5341499dfa3825e99"
|
||||
|
@ -5171,7 +5189,7 @@ lodash.memoize@^4.1.2:
|
|||
resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-4.1.2.tgz#bcc6c49a42a2840ed997f323eada5ecd182e0bfe"
|
||||
integrity sha1-vMbEmkKihA7Zl/Mj6tpezRguC/4=
|
||||
|
||||
lodash.merge@4.6.2:
|
||||
lodash.merge@4.6.2, lodash.merge@^4.6.2:
|
||||
version "4.6.2"
|
||||
resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a"
|
||||
integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==
|
||||
|
@ -5186,12 +5204,7 @@ lodash.toarray@^4.4.0:
|
|||
resolved "https://registry.yarnpkg.com/lodash.toarray/-/lodash.toarray-4.4.0.tgz#24c4bfcd6b2fba38bfd0594db1179d8e9b656561"
|
||||
integrity sha1-JMS/zWsvuji/0FlNsRedjptlZWE=
|
||||
|
||||
lodash.truncate@^4.4.2:
|
||||
version "4.4.2"
|
||||
resolved "https://registry.yarnpkg.com/lodash.truncate/-/lodash.truncate-4.4.2.tgz#5a350da0b1113b837ecfffd5812cbe58d6eae193"
|
||||
integrity sha1-WjUNoLERO4N+z//VgSy+WNbq4ZM=
|
||||
|
||||
lodash@4.x, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.21, lodash@^4.17.4, lodash@^4.7.0:
|
||||
lodash@4.x, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.4, lodash@^4.7.0:
|
||||
version "4.17.21"
|
||||
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c"
|
||||
integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==
|
||||
|
@ -5284,7 +5297,7 @@ merge-stream@^2.0.0:
|
|||
resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60"
|
||||
integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==
|
||||
|
||||
merge2@^1.3.0:
|
||||
merge2@^1.3.0, merge2@^1.4.1:
|
||||
version "1.4.1"
|
||||
resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae"
|
||||
integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==
|
||||
|
@ -5926,6 +5939,13 @@ prelude-ls@~1.1.2:
|
|||
resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54"
|
||||
integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=
|
||||
|
||||
prettier-linter-helpers@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz#d23d41fe1375646de2d0104d3454a3008802cf7b"
|
||||
integrity sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==
|
||||
dependencies:
|
||||
fast-diff "^1.1.2"
|
||||
|
||||
prettier@^2.2.1:
|
||||
version "2.2.1"
|
||||
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.2.1.tgz#795a1a78dd52f073da0cd42b21f9c91381923ff5"
|
||||
|
@ -5951,11 +5971,6 @@ process@^0.11.10:
|
|||
resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182"
|
||||
integrity sha1-czIwDoQBYb2j5podHZGn1LwW8YI=
|
||||
|
||||
progress@^2.0.0:
|
||||
version "2.0.3"
|
||||
resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8"
|
||||
integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==
|
||||
|
||||
promise@^7.1.1:
|
||||
version "7.3.1"
|
||||
resolved "https://registry.yarnpkg.com/promise/-/promise-7.3.1.tgz#064b72602b18f90f29192b8b1bc418ffd1ebd3bf"
|
||||
|
@ -6182,10 +6197,10 @@ regex-not@^1.0.0, regex-not@^1.0.2:
|
|||
extend-shallow "^3.0.2"
|
||||
safe-regex "^1.1.0"
|
||||
|
||||
regexpp@^3.0.0, regexpp@^3.1.0:
|
||||
version "3.1.0"
|
||||
resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.1.0.tgz#206d0ad0a5648cffbdb8ae46438f3dc51c9f78e2"
|
||||
integrity sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==
|
||||
regexpp@^3.2.0:
|
||||
version "3.2.0"
|
||||
resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.2.0.tgz#0425a2768d8f23bad70ca4b90461fa2f1213e1b2"
|
||||
integrity sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==
|
||||
|
||||
relay-compiler-language-typescript@>=14.0.0:
|
||||
version "15.0.0"
|
||||
|
@ -6298,11 +6313,6 @@ require-directory@^2.1.1:
|
|||
resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42"
|
||||
integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I=
|
||||
|
||||
require-from-string@^2.0.2:
|
||||
version "2.0.2"
|
||||
resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909"
|
||||
integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==
|
||||
|
||||
require-main-filename@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b"
|
||||
|
@ -6443,7 +6453,7 @@ scheduler@^0.20.2:
|
|||
resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7"
|
||||
integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==
|
||||
|
||||
semver@7.x, semver@^7.0.0, semver@^7.2.1, semver@^7.3.2, semver@^7.3.4, semver@~7.3.0:
|
||||
semver@7.x, semver@^7.0.0, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5, semver@~7.3.0:
|
||||
version "7.3.5"
|
||||
resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.5.tgz#0b621c879348d8998e4b0e4be94b3f12e6018ef7"
|
||||
integrity sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==
|
||||
|
@ -6540,15 +6550,6 @@ slash@^3.0.0:
|
|||
resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634"
|
||||
integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==
|
||||
|
||||
slice-ansi@^4.0.0:
|
||||
version "4.0.0"
|
||||
resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-4.0.0.tgz#500e8dd0fd55b05815086255b3195adf2a45fe6b"
|
||||
integrity sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==
|
||||
dependencies:
|
||||
ansi-styles "^4.0.0"
|
||||
astral-regex "^2.0.0"
|
||||
is-fullwidth-code-point "^3.0.0"
|
||||
|
||||
snapdragon-node@^2.0.1:
|
||||
version "2.1.1"
|
||||
resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b"
|
||||
|
@ -6797,6 +6798,13 @@ strip-ansi@^6.0.0:
|
|||
dependencies:
|
||||
ansi-regex "^5.0.0"
|
||||
|
||||
strip-ansi@^6.0.1:
|
||||
version "6.0.1"
|
||||
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
|
||||
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
|
||||
dependencies:
|
||||
ansi-regex "^5.0.1"
|
||||
|
||||
strip-bom@^4.0.0:
|
||||
version "4.0.0"
|
||||
resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-4.0.0.tgz#9c3505c1db45bcedca3d9cf7a16f5c5aa3901878"
|
||||
|
@ -6887,21 +6895,6 @@ sync-fetch@0.3.1:
|
|||
buffer "^5.7.0"
|
||||
node-fetch "^2.6.1"
|
||||
|
||||
table@^6.0.4:
|
||||
version "6.0.9"
|
||||
resolved "https://registry.yarnpkg.com/table/-/table-6.0.9.tgz#790a12bf1e09b87b30e60419bafd6a1fd85536fb"
|
||||
integrity sha512-F3cLs9a3hL1Z7N4+EkSscsel3z55XT950AvB05bwayrNg5T1/gykXtigioTAjbltvbMSJvvhFCbnf6mX+ntnJQ==
|
||||
dependencies:
|
||||
ajv "^8.0.1"
|
||||
is-boolean-object "^1.1.0"
|
||||
is-number-object "^1.0.4"
|
||||
is-string "^1.0.5"
|
||||
lodash.clonedeep "^4.5.0"
|
||||
lodash.flatten "^4.4.0"
|
||||
lodash.truncate "^4.4.2"
|
||||
slice-ansi "^4.0.0"
|
||||
string-width "^4.2.0"
|
||||
|
||||
tar-fs@^2.1.0:
|
||||
version "2.1.1"
|
||||
resolved "https://registry.yarnpkg.com/tar-fs/-/tar-fs-2.1.1.tgz#489a15ab85f1f0befabb370b7de4f9eb5cbe8784"
|
||||
|
@ -7165,7 +7158,7 @@ tslib@~2.0.1:
|
|||
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.0.3.tgz#8e0741ac45fc0c226e58a17bfc3e64b9bc6ca61c"
|
||||
integrity sha512-uZtkfKblCEQtZKBF6EBXVZeQNl82yqtDQdv+eck8u7tdPxjLu2/lp5/uPW+um2tpuxINHWy3GhiccY7QgEaVHQ==
|
||||
|
||||
tsutils@^3.17.1:
|
||||
tsutils@^3.21.0:
|
||||
version "3.21.0"
|
||||
resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.21.0.tgz#b48717d394cea6c1e096983eed58e9d61715b623"
|
||||
integrity sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==
|
||||
|
|
Загрузка…
Ссылка в новой задаче