Skip to content

Commit 1cf001a

Browse files
authored
feat!: rename and remove legacy code (#1052)
1 parent 4db0000 commit 1cf001a

File tree

94 files changed

+127
-3042
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+127
-3042
lines changed

.github/ISSUE_TEMPLATE/config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ blank_issues_enabled: false
33
contact_links:
44
- name: ✋ Question
55
about: You have a question about something you're not sure about
6-
url: https://github.com/jasonkuhrt/graphql-request/discussions/new
6+
url: https://github.com/jasonkuhrt/graffle/discussions/new

README.md

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
1+
> [!IMPORTANT]
2+
> The next version (`8`) of `graphql-request` is being renamed to `graffle`. It has the same base simplicity but with many fixes, enhancements, and major new type safe features.
3+
> It is not released yet but will be in the coming weeks/months and is already usable. Learn more about it [here](https://github.com/jasonkuhrt/graffle/discussions/1026). You can see the in progress website at https://graffle.js.org.
4+
>
5+
> The following README is still for `[email protected]`
6+
17
# graphql-request
28

39
Minimal GraphQL client supporting Node and browsers for scripts or simple apps.
410

5-
![GitHub Action](https://github.com/jasonkuhrt/graphql-request/workflows/trunk/badge.svg) [![npm version](https://badge.fury.io/js/graphql-request.svg)](https://badge.fury.io/js/graphql-request)
11+
![GitHub Action](https://github.com/jasonkuhrt/graffle/workflows/trunk/badge.svg) [![npm version](https://badge.fury.io/js/graffle.svg)](https://badge.fury.io/js/graffle)
612

713
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
814
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
@@ -23,8 +29,8 @@ Minimal GraphQL client supporting Node and browsers for scripts or simple apps.
2329
- [Knowledge Base](#knowledge-base)
2430
- [Why was the file upload feature taken away? Will it return?](#why-was-the-file-upload-feature-taken-away-will-it-return)
2531
- [Why do I have to install `graphql`?](#why-do-i-have-to-install-graphql)
26-
- [Do I need to wrap my GraphQL documents inside the `gql` template exported by `graphql-request`?](#do-i-need-to-wrap-my-graphql-documents-inside-the-gql-template-exported-by-graphql-request)
27-
- [What sets `graphql-request` apart from other clients like Apollo, Relay, etc.?](#what-sets-graphql-request-apart-from-other-clients-like-apollo-relay-etc)
32+
- [Do I need to wrap my GraphQL documents inside the `gql` template exported by `graffle`?](#do-i-need-to-wrap-my-graphql-documents-inside-the-gql-template-exported-by-graffle)
33+
- [What sets `graffle` apart from other clients like Apollo, Relay, etc.?](#what-sets-graffle-apart-from-other-clients-like-apollo-relay-etc)
2834
- [Project Stats](#project-stats)
2935
- [Package Installs](#package-installs)
3036
- [Repo Beats](#repo-beats)
@@ -43,7 +49,7 @@ Minimal GraphQL client supporting Node and browsers for scripts or simple apps.
4349
## Install
4450

4551
```sh
46-
npm add graphql-request graphql
52+
npm add graffle graphql
4753
```
4854

4955
#### TypeScript Setup
@@ -58,7 +64,7 @@ This package uses [`package.exports`](https://www.typescriptlang.org/docs/handbo
5864
Send a GraphQL document using a static request function:
5965

6066
```js
61-
import { gql, request } from 'graphql-request'
67+
import { gql, request } from 'graffle'
6268

6369
const document = gql`
6470
{
@@ -84,7 +90,7 @@ await request({
8490
A class is available for constructing your own instances:
8591

8692
```js
87-
import { gql, GraphQLClient } from 'graphql-request'
93+
import { gql, GraphQLClient } from 'graffle'
8894

8995
const document = gql`
9096
{
@@ -163,7 +169,7 @@ Return both the errors and data, only works with `rawRequest`.
163169

164170
### IgnoreOperationName
165171

166-
OperationName has been introduced to address issues reported here [Support operation name](https://github.com/jasonkuhrt/graphql-request/issues/64),
172+
OperationName has been introduced to address issues reported here [Support operation name](https://github.com/jasonkuhrt/graffle/issues/64),
167173
However, on certain occasions this information may not be needed in requests. In such cases, you might consider ignoring operationName to avoid the extraction steps currently performed by a parsing operation when the document is provided in string format.
168174

169175
By default the GraphQLClient tries to extract the operationName from the document.
@@ -185,28 +191,28 @@ const client = new GraphQLClient(endpoint, {
185191

186192
#### Why was the file upload feature taken away? Will it return?
187193

188-
In [this issue](https://github.com/jasonkuhrt/graphql-request/issues/500) we decided to make this library more stable and maintainable. In principal the feature is still in scope of this library and will make a return when we find time to do the feature right.
194+
In [this issue](https://github.com/jasonkuhrt/graffle/issues/500) we decided to make this library more stable and maintainable. In principal the feature is still in scope of this library and will make a return when we find time to do the feature right.
189195

190196
#### Why do I have to install `graphql`?
191197

192-
`graphql-request` uses methods exposed by the `graphql` package to handle some internal logic. On top of that, for TypeScript users, some types are used from the `graphql` package to provide better typings.
198+
`graffle` uses methods exposed by the `graphql` package to handle some internal logic. On top of that, for TypeScript users, some types are used from the `graphql` package to provide better typings.
193199

194-
#### Do I need to wrap my GraphQL documents inside the `gql` template exported by `graphql-request`?
200+
#### Do I need to wrap my GraphQL documents inside the `gql` template exported by `graffle`?
195201

196202
No. It is there for convenience so that you can get the tooling support like automatic formatting and syntax highlighting. You can use `gql` from `graphql-tag` if you need it for some reason too.
197203

198-
#### What sets `graphql-request` apart from other clients like Apollo, Relay, etc.?
204+
#### What sets `graffle` apart from other clients like Apollo, Relay, etc.?
199205

200-
`graphql-request` is the most minimal and simplest to use GraphQL client. It's perfect for small scripts or simple apps.
206+
`graffle` is the most minimal and simplest to use GraphQL client. It's perfect for small scripts or simple apps.
201207

202-
Compared to GraphQL clients like Apollo or Relay, `graphql-request` doesn't have a built-in cache and has no integrations for frontend frameworks. The goal is to keep the package and API as minimal as possible.
208+
Compared to GraphQL clients like Apollo or Relay, `graffle` doesn't have a built-in cache and has no integrations for frontend frameworks. The goal is to keep the package and API as minimal as possible.
203209

204210
## Project Stats
205211

206212
### Package Installs
207213

208-
<a href="https://npm-compare.com/graphql-request#timeRange=FIVE_YEARS" target="_blank">
209-
<img src="https://npm-compare.com/img/npm-trend/FIVE_YEARS/graphql-request.png" width="100%" alt="NPM Usage Trend of graphql-request" />
214+
<a href="https://npm-compare.com/graffle#timeRange=FIVE_YEARS" target="_blank">
215+
<img src="https://npm-compare.com/img/npm-trend/FIVE_YEARS/graffle.png" width="100%" alt="NPM Usage Trend of graffle" />
210216
</a>
211217

212218
### Repo Beats

examples/$generated-clients/SocialStudies/Client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { createPrefilled } from '../../../src/entrypoints/graffle/client.js'
1+
import { createPrefilled } from '../../../src/entrypoints/client.js'
22

33
import { $defaultSchemaUrl, $Index } from './SchemaRuntime.js'
44

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export * from '../../../src/entrypoints/graffle/scalars.js'
1+
export * from '../../../src/entrypoints/scalars.js'

examples/$generated-clients/SocialStudies/SchemaBuildtime.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type * as $ from '../../../src/entrypoints/graffle/schema.js'
1+
import type * as $ from '../../../src/entrypoints/schema.js'
22
import type * as $Scalar from './Scalar.ts'
33

44
// ------------------------------------------------------------ //

examples/$generated-clients/SocialStudies/SchemaRuntime.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* eslint-disable */
22

3-
import * as $ from '../../../src/entrypoints/graffle/schema.js'
3+
import * as $ from '../../../src/entrypoints/schema.js'
44
import * as $Scalar from './Scalar.js'
55

66
export const $defaultSchemaUrl = new URL('https://countries.trevorblades.com/graphql')

examples/$generated-clients/SocialStudies/Select.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import type { ResultSet, SelectionSet } from '../../../src/entrypoints/graffle/schema.js'
1+
import type { ResultSet, SelectionSet } from '../../../src/entrypoints/schema.js'
22
import type { Index } from './Index.js'
33

44
// Runtime
55
// -------
66

7-
import { createSelect } from '../../../src/entrypoints/graffle/client.js'
7+
import { createSelect } from '../../../src/entrypoints/client.js'
88
export const Select = createSelect(`default`)
99

1010
// Buildtime

examples/legacy/configuration-fetch-options.ts

Lines changed: 0 additions & 31 deletions
This file was deleted.

examples/legacy/configuration-incremental-endpoint.ts

Lines changed: 0 additions & 9 deletions
This file was deleted.

examples/legacy/configuration-incremental-request-headers.ts

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)