Skip to content

Commit

Permalink
New plugin: TypeScript Vue Apollo Smart Operations (#5825)
Browse files Browse the repository at this point in the history
  • Loading branch information
sgarner authored Jun 20, 2021
1 parent dc9cded commit 0c45bcc
Show file tree
Hide file tree
Showing 28 changed files with 3,549 additions and 103 deletions.
9 changes: 9 additions & 0 deletions .changeset/five-moles-knock.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
'@graphql-codegen/typescript-vue-apollo-smart-ops': major
'@graphql-codegen/cli': patch
'@graphql-codegen/typescript': patch
'@graphql-codegen/config-schema': patch
'@graphql-codegen/website': patch
---

Add new plugin typescript-vue-apollo-smart-ops
7 changes: 7 additions & 0 deletions dev-test/codegen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,13 @@ generates:
- typescript
- typescript-operations
- typescript-vue-apollo
./dev-test/githunt/types.vueApolloSmartOps.ts:
schema: ./dev-test/githunt/schema.json
documents: ./dev-test/githunt/**/*.graphql
plugins:
- typescript
- typescript-operations
- typescript-vue-apollo-smart-ops
./dev-test/star-wars/types.ts:
schema: ./dev-test/star-wars/schema.json
documents: ./dev-test/star-wars/**/*.graphql
Expand Down
44 changes: 22 additions & 22 deletions dev-test/githunt/typed-document-nodes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ export type VoteMutation = { __typename?: 'Mutation' } & {
>;
};

export const CommentsPageCommentFragmentDoc = {
export const CommentsPageCommentFragmentDoc = ({
kind: 'Document',
definitions: [
{
Expand Down Expand Up @@ -296,8 +296,8 @@ export const CommentsPageCommentFragmentDoc = {
},
},
],
} as unknown as DocumentNode<CommentsPageCommentFragment, unknown>;
export const VoteButtonsFragmentDoc = {
} as unknown) as DocumentNode<CommentsPageCommentFragment, unknown>;
export const VoteButtonsFragmentDoc = ({
kind: 'Document',
definitions: [
{
Expand All @@ -320,8 +320,8 @@ export const VoteButtonsFragmentDoc = {
},
},
],
} as unknown as DocumentNode<VoteButtonsFragment, unknown>;
export const RepoInfoFragmentDoc = {
} as unknown) as DocumentNode<VoteButtonsFragment, unknown>;
export const RepoInfoFragmentDoc = ({
kind: 'Document',
definitions: [
{
Expand Down Expand Up @@ -359,8 +359,8 @@ export const RepoInfoFragmentDoc = {
},
},
],
} as unknown as DocumentNode<RepoInfoFragment, unknown>;
export const FeedEntryFragmentDoc = {
} as unknown) as DocumentNode<RepoInfoFragment, unknown>;
export const FeedEntryFragmentDoc = ({
kind: 'Document',
definitions: [
{
Expand Down Expand Up @@ -399,8 +399,8 @@ export const FeedEntryFragmentDoc = {
...VoteButtonsFragmentDoc.definitions,
...RepoInfoFragmentDoc.definitions,
],
} as unknown as DocumentNode<FeedEntryFragment, unknown>;
export const OnCommentAddedDocument = {
} as unknown) as DocumentNode<FeedEntryFragment, unknown>;
export const OnCommentAddedDocument = ({
kind: 'Document',
definitions: [
{
Expand Down Expand Up @@ -451,8 +451,8 @@ export const OnCommentAddedDocument = {
},
},
],
} as unknown as DocumentNode<OnCommentAddedSubscription, OnCommentAddedSubscriptionVariables>;
export const CommentDocument = {
} as unknown) as DocumentNode<OnCommentAddedSubscription, OnCommentAddedSubscriptionVariables>;
export const CommentDocument = ({
kind: 'Document',
definitions: [
{
Expand Down Expand Up @@ -568,8 +568,8 @@ export const CommentDocument = {
},
...CommentsPageCommentFragmentDoc.definitions,
],
} as unknown as DocumentNode<CommentQuery, CommentQueryVariables>;
export const CurrentUserForProfileDocument = {
} as unknown) as DocumentNode<CommentQuery, CommentQueryVariables>;
export const CurrentUserForProfileDocument = ({
kind: 'Document',
definitions: [
{
Expand All @@ -594,8 +594,8 @@ export const CurrentUserForProfileDocument = {
},
},
],
} as unknown as DocumentNode<CurrentUserForProfileQuery, CurrentUserForProfileQueryVariables>;
export const FeedDocument = {
} as unknown) as DocumentNode<CurrentUserForProfileQuery, CurrentUserForProfileQueryVariables>;
export const FeedDocument = ({
kind: 'Document',
definitions: [
{
Expand Down Expand Up @@ -660,8 +660,8 @@ export const FeedDocument = {
},
...FeedEntryFragmentDoc.definitions,
],
} as unknown as DocumentNode<FeedQuery, FeedQueryVariables>;
export const SubmitRepositoryDocument = {
} as unknown) as DocumentNode<FeedQuery, FeedQueryVariables>;
export const SubmitRepositoryDocument = ({
kind: 'Document',
definitions: [
{
Expand Down Expand Up @@ -697,8 +697,8 @@ export const SubmitRepositoryDocument = {
},
},
],
} as unknown as DocumentNode<SubmitRepositoryMutation, SubmitRepositoryMutationVariables>;
export const SubmitCommentDocument = {
} as unknown) as DocumentNode<SubmitRepositoryMutation, SubmitRepositoryMutationVariables>;
export const SubmitCommentDocument = ({
kind: 'Document',
definitions: [
{
Expand Down Expand Up @@ -745,8 +745,8 @@ export const SubmitCommentDocument = {
},
...CommentsPageCommentFragmentDoc.definitions,
],
} as unknown as DocumentNode<SubmitCommentMutation, SubmitCommentMutationVariables>;
export const VoteDocument = {
} as unknown) as DocumentNode<SubmitCommentMutation, SubmitCommentMutationVariables>;
export const VoteDocument = ({
kind: 'Document',
definitions: [
{
Expand Down Expand Up @@ -803,4 +803,4 @@ export const VoteDocument = {
},
},
],
} as unknown as DocumentNode<VoteMutation, VoteMutationVariables>;
} as unknown) as DocumentNode<VoteMutation, VoteMutationVariables>;
4 changes: 2 additions & 2 deletions dev-test/githunt/types.urql.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ export function useVoteMutation() {
return Urql.useMutation<VoteMutation, VoteMutationVariables>(VoteDocument);
}
import { IntrospectionQuery } from 'graphql';
export default {
export default ({
__schema: {
queryType: {
name: 'Query',
Expand Down Expand Up @@ -981,7 +981,7 @@ export default {
],
directives: [],
},
} as unknown as IntrospectionQuery;
} as unknown) as IntrospectionQuery;
export type WithTypename<T extends { __typename?: any }> = { [K in Exclude<keyof T, '__typename'>]?: T[K] } & {
__typename: NonNullable<T['__typename']>;
};
Expand Down
Loading

0 comments on commit 0c45bcc

Please sign in to comment.