You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using https://www.graphql-code-generator.com, it generates a large TS file with hooks. I expected webpack to take small parts of the file into the chunks it needs, but instead it generates a large chunk with this file.
graphql.ts
importtype{DocumentNode}from'graphql';import*asVueApolloComposablefrom'@vue/apollo-composable';importtype*asVueCompositionApifrom'@vue/composition-api';// .../** * __useCreateReactionMutation__ * * To run a mutation, you first call `useCreateReactionMutation` within a Vue component and pass it any options that fit your needs. * When your component renders, `useCreateReactionMutation` returns an object that includes: * - A mutate function that you can call at any time to execute the mutation * - Several other properties: https://v4.apollo.vuejs.org/api/use-mutation.html#return * * @param options that will be passed into the mutation, supported options are listed on: https://v4.apollo.vuejs.org/guide-composable/mutation.html#options; * * @example * const { mutate, loading, error, onDone } = useCreateReactionMutation({ * variables: { * input: // value for 'input' * }, * }); */exportfunctionuseCreateReactionMutation(options: VueApolloComposable.UseMutationOptions<CreateReactionMutation,CreateReactionMutationVariables>|ReactiveFunction<VueApolloComposable.UseMutationOptions<CreateReactionMutation,CreateReactionMutationVariables>>){returnVueApolloComposable.useMutation<CreateReactionMutation,CreateReactionMutationVariables>(CreateReactionDocument,options);}exporttypeCreateReactionMutationCompositionFunctionResult=VueApolloComposable.UseMutationReturn<CreateReactionMutation,CreateReactionMutationVariables>;exportconstDeleteReactionDocument={"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"deleteReaction"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"DeleteReactionInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"deleteReaction"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"deleted"}}]}}]}}]}asunknownasDocumentNode;/** * __useDeleteReactionMutation__ * * To run a mutation, you first call `useDeleteReactionMutation` within a Vue component and pass it any options that fit your needs. * When your component renders, `useDeleteReactionMutation` returns an object that includes: * - A mutate function that you can call at any time to execute the mutation * - Several other properties: https://v4.apollo.vuejs.org/api/use-mutation.html#return * * @param options that will be passed into the mutation, supported options are listed on: https://v4.apollo.vuejs.org/guide-composable/mutation.html#options; * * @example * const { mutate, loading, error, onDone } = useDeleteReactionMutation({ * variables: { * input: // value for 'input' * }, * }); */exportfunctionuseDeleteReactionMutation(options: VueApolloComposable.UseMutationOptions<DeleteReactionMutation,DeleteReactionMutationVariables>|ReactiveFunction<VueApolloComposable.UseMutationOptions<DeleteReactionMutation,DeleteReactionMutationVariables>>){returnVueApolloComposable.useMutation<DeleteReactionMutation,DeleteReactionMutationVariables>(DeleteReactionDocument,options);}exporttypeDeleteReactionMutationCompositionFunctionResult=VueApolloComposable.UseMutationReturn<DeleteReactionMutation,DeleteReactionMutationVariables>;exportconstCreateReleaseContributorDocument={"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"createReleaseContributor"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"CreateReleaseContributorInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"createReleaseContributor"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"contributor"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ReleaseContributorCommon"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ReleaseContributorCommon"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ReleaseContributor"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"startOn"}},{"kind":"Field","name":{"kind":"Name","value":"endOn"}},{"kind":"Field","name":{"kind":"Name","value":"tasks"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"ranges"}}]}},{"kind":"Field","name":{"kind":"Name","value":"user"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"slug"}},{"kind":"Field","name":{"kind":"Name","value":"username"}},{"kind":"Field","name":{"kind":"Name","value":"verified"}},{"kind":"Field","name":{"kind":"Name","value":"avatar"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"UserAvatarCommon"}}]}},{"kind":"Field","name":{"kind":"Name","value":"roles"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"displayColor"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"community"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"slug"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"verified"}},{"kind":"Field","name":{"kind":"Name","value":"avatar"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","alias":{"kind":"Name","value":"preview"},"name":{"kind":"Name","value":"resize"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"width"},"value":{"kind":"IntValue","value":"192"}},{"kind":"Argument","name":{"kind":"Name","value":"height"},"value":{"kind":"IntValue","value":"192"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"width"}},{"kind":"Field","name":{"kind":"Name","value":"height"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"UserAvatarCommon"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ImageFile"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","alias":{"kind":"Name","value":"preview"},"name":{"kind":"Name","value":"resize"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"width"},"value":{"kind":"IntValue","value":"192"}},{"kind":"Argument","name":{"kind":"Name","value":"height"},"value":{"kind":"IntValue","value":"192"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"width"}},{"kind":"Field","name":{"kind":"Name","value":"height"}},{"kind":"Field","name":{"kind":"Name","value":"url"}}]}}]}}]}asunknownasDocumentNode;
How is it used:
import{useCreateReactionMutation}from'@/graphql';
I am unable to provide webpack.config as it is the default from Nuxt.js.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm using https://www.graphql-code-generator.com, it generates a large TS file with hooks. I expected webpack to take small parts of the file into the chunks it needs, but instead it generates a large chunk with this file.
graphql.ts
How is it used:
I am unable to provide
webpack.config
as it is the default from Nuxt.js.Beta Was this translation helpful? Give feedback.
All reactions