Skip to content

v0.17.0

Compare
Choose a tag to compare
@piglovesyou piglovesyou released this 13 Mar 04:47
· 214 commits to main since this release

New features

babel-plugin-macros support

We now exports graphql-let/macro. It needs the least configuration. Now Create React App is able to use graphql-let without ejecting.

import { gql, load } from 'graphql-let/macro'

const { useQuery } = load('./a.graphql')

gql() and load() support in all entrypoints

gql() used to be only for Babel Plugin, but now you can use it in webpack loader and babel-plugin-macros.

import { gql, load } from 'graphql-let'              // If you use webpack loader or Babel Plugin
import { gql, load } from 'graphql-let/macro'  // If you use babel-plugin-macros

const { useNewsQuery } = gql("query News { braa }")
const { useViewerQuery } = load('./viewer.graphql')

Breaking changes

Import named export gql instead of default export for Babel Plugin

- import gql from 'graphql-let'
+ import { gql } from 'graphql-let'

A config name changes. "typeInjectEntrypoint" from "gqlDtsEntrypoint" in .graphql-let.yml.

- gqlDtsEntrypoint: graphql-let-custom-typings/index.d.ts
+ typeInjectEntrypoint: graphql-let-custom-typings/index.d.ts

Other improvements

More efficient code generation. It used to call GraphQL code generator API for each type (document file, schema file, string literal document) but now it calls it one for all types.