Skip to content

@apollo/client@4.4.0-alpha.0

Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 10 Nov 23:21
· 3 commits to main since this release
553fa0f

Minor Changes

  • #13508 c1558e3 Thanks @jerelmiller! - Support GraphQL 17 experimental fragment arguments. Fragment definitions can now include variable definitions, and fragment spreads can pass arguments for them.

    fragment UserFragment($avatarSize: Int!) on User {
      id
      avatar(size: $avatarSize)
    }

    Arguments can be passed to the fragment where it's used:

    query CurrentUserQuery($friendAvatarSize: Int!) {
      currentUser {
        id
        ...UserFragment(avatarSize: 32)
    
        friends {
          id
          ...UserFragment(avatarSize: $friendAvatarSize)
        }
      }
    }

    You must enable experimental fragment arguments to use this feature:

    import { enableExperimentalFragmentVariables } from "@apollo/client";
    
    enableExperimentalFragmentVariables();

    [!NOTE]
    This MUST be called before any GraphQL documents are parsed. We recommend calling this in your application's entry file.