Skip to content

Releases: piglovesyou/graphql-let

v0.18.5

08 Sep 13:52
Compare
Choose a tag to compare

This patch version includes JEST v26 & v27 support. So nice, @cbmd!

v0.18.4

12 Jun 10:04
Compare
Choose a tag to compare

Fixes #506 again. It now prints PRINT_PREFIX + err.toString() + '\n' + err.stack to use GraphQLError's .toString().

v0.18.3

12 Jun 08:07
Compare
Choose a tag to compare

Fixed bug #516

v0.18.2

12 Jun 08:08
Compare
Choose a tag to compare

Fixes bug #506

v0.18.1

28 May 11:24
Compare
Choose a tag to compare

This release fixes a bug introduced in v0.18.0, described in #495. Thank you for all your investigation, @rtrembecky.

v0.18.0

19 May 01:31
Compare
Choose a tag to compare

v0.18.0 release🎉

v0.18.0 fixed #60, which pointed out duplicated generation of schema types are in trouble, especially in production-size GraphQL schema possibly having massive stitched GrpahQL types.

The types, generated by the typescript plugin, are now all in graphql-let/__generated__/__types__ and shared by the other outputs. This requires you to migrate to use v0.18.0.

Many users realize this release. Thank you for the awesome Preset, @dotansimha. Thanks for your support, @StevenLangbroek, @acao.

Frame 11

Migration guide to v0.18.0

1. Install additional peer dependency

Please install @graphql-codegen/import-types-preset as an additional peer dependency.

yarn add -D @graphql-codegen/import-types-preset

2. Change .graphql-let.yml

Please change your config file as below. schemaEntrypoint became obsolete since it's always graphql-let/__generated__/__types__ from v0.18.0. The plugin typescript is recommended to remove, also because it's always in graphql-let/__generated__/__types__ now.

  schema: '**/*.graphqls'
- # "schemaEntrypoint" became obsolete
- schemaEntrypoint: lib/type-defs.graphqls
  documents: '**/*.graphql'
  plugins:
-   # "typescript" is not recommended
-   - typescript
    - typescript-operations
    - typescript-react-apollo
- cacheDir: __generated__
+ # ".cache" is now recommended to distinguish from "graphql-let/__generated__"
+ cacheDir: .cache

Please note that files in cacheDir are only intermediates. Exclude them from your TypeScript source.

  // tsconfig.json
  {
+   "excludes": [".cache"]
  }

Also, you're still able to have the plugin typescript in your config to keep importing types from the per-document output (*.graphql.d.ts). If so, you can skip step 3.

3. Change where you import types from

Again, your schema types are extracted and shared as graphql-let/__generated__/__types__. Please replace import parts of your source.

- import { User, ViewerDocument } from './viewer.graphql'
+ import { User } from 'graphql-let/__generated__/__types__'
+ import { ViewerDocument } from './viewer.graphql'

Optionally, you may want to have a path alias to it in your tsconfig.json for convenience.

  {
    "compilerOptions": {
      "noEmit": true,
      "esModuleInterop": true,
+     "baseUrl": ".",
+     "paths": {
+       "@graphql-types@": ["node_modules/@types/graphql-let/__generated__/__types__"]
+     }
    }
  }
import { User } from '@graphql-types@'

For Resolver Types users

Resolver Types also go in graphql-let/__generated__/__types__.

- import { Resolvers } from "./${config.schemaEntrypoint}";
+ import { Resolvers } from "graphql-let/__generated__/__types__";

v0.17.2

04 May 08:19
Compare
Choose a tag to compare

Supports silent option to suppress all the standard output coming from graphql-let.

v0.17.0

13 Mar 04:47
Compare
Choose a tag to compare

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.

v0.16.3

17 Nov 15:16
Compare
Choose a tag to compare

#226 Accept absolute config file paths in webpack config

7a14dfe by @hasparus 🎉

#263 Accept config paths in jestTransformer

e59286a by @andrenanninga 🎉

v0.16.1

23 Sep 01:27
Compare
Choose a tag to compare

configFile option in webpack loader options

Now you put your webpack.config.js in a subdirectory by passing a path to .graphql-let.yml. Excellent work, @hasparus!!

Test