github refinedev/refine @refinedev/graphql@6.5.0

Minor Changes

  • #5742 028ba6a11d0 Thanks @alicanerdurmaz! - feat: add gqlQuery and gqlMutation support. #5743

    Previously, @refinedev/graphql package only supported GraphQL operations through meta.fields.

    Now we've added gqlQuery and gqlMutation fields in meta object.

    You can utilize these fields along with graphql-tag package to build your queries/mutations.

    See the updated documentation for more information: https://refine.dev/docs/packages/data-providers/graphql

    Query Example:

    import { useList } from "@refinedev/core";
    import gql from "graphql-tag";
    
    const POSTS_LIST_QUERY = gql`
      query PostList($where: JSON, $sort: String) {
        posts(where: $where, sort: $sort) {
          id
          title
          content
          category {
            id
          }
        }
      }
    `;
    
    const { data } = useList({
      resource: "posts",
      meta: { gqlQuery: POSTS_QUERY },
    });

    Mutation Example:

    import { useForm } from "@refinedev/core";
    import gql from "graphql-tag";
    
    const POST_CREATE_MUTATION = gql`
      mutation createPost($input: createPostInput!) {
        createPost(input: $input) {
          id
          title
          content
          category {
            id
          }
        }
      }
    `;
    
    const { formProps } = useForm({
      resource: "posts",
      meta: { gqlMutation: CREATE_POST_MUTATION },
    });

Patch Changes

  • #5765 0c197d82393 Thanks @aliemir! - refactor: package bundles and package.json configuration for exports

    Previously, Refine packages had exported ESM and CJS bundles with same .js extension and same types for both with .d.ts extensions. This was causing issues with bundlers and compilers to pick up the wrong files for the wrong environment. Now we're outputting ESM bundles with .mjs extension and CJS bundles with .cjs extension. Also types are now exported with both .d.mts and .d.cts extensions.

    In older versions ESM and CJS outputs of some packages were using wrong imports/requires to dependencies causing errors in some environments. This will be fixed since now we're also enforcing the module type with extensions.

    Above mentioned changes also supported with changes in package.json files of the packages to support the new extensions and types. All Refine packages now include exports fields in their configuration to make sure the correct bundle is picked up by the bundlers and compilers.

  • #5754 56ed144a0f5 Thanks @alicanerdurmaz! - chore: TypeScript upgraded to v5.x.x. #5752

Don't miss a new refine release

NewReleases is sending notifications on new releases.