From 5cf81c2ce2314e5d896ce8ddf8d45a12245dbc44 Mon Sep 17 00:00:00 2001 From: Adrien Crivelli Date: Thu, 17 Oct 2024 12:41:53 +0200 Subject: [PATCH] Smaller bundle for `gql` Casting, instead of wrapping, the existing `gql` function, save ~60 bytes, and avoid an extra function call at runtime --- packages/apollo-angular/src/gql.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/packages/apollo-angular/src/gql.ts b/packages/apollo-angular/src/gql.ts index 8a318531c..8a1bbdf6b 100644 --- a/packages/apollo-angular/src/gql.ts +++ b/packages/apollo-angular/src/gql.ts @@ -1,11 +1,9 @@ import { gql as gqlTag, TypedDocumentNode } from '@apollo/client/core'; -function typedGQLTag( - literals: ReadonlyArray | Readonly, - ...placeholders: any[] -): TypedDocumentNode { - return gqlTag(literals, ...placeholders); -} +const typedGQLTag: ( + literals: ReadonlyArray | Readonly, + ...placeholders: any[] +) => TypedDocumentNode = gqlTag; export const gql = typedGQLTag; export const graphql = typedGQLTag;