Spring 🌼 Status Update #922
jasonkuhrt
announced in
Announcements
Replies: 1 comment 5 replies
-
Hello @jasonkuhrt, thank you for your continued effort on the
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"verbatimModuleSyntax": false
},
"include": ["./**/*.ts"]
}
{
"scripts": {
"graphql:fetch-schema": "graphql-codegen",
"graphql:generate-client": "pnpm run graphql:fetch-schema && graffle --schema ./graphql/schema/schema.graphql --output ./graphql/client --format false --schemaErrorTypes false && prettier --write ./graphql/client"
}
} import type { IGraphQLConfig } from 'graphql-config'
import type { CodegenConfig } from '@graphql-codegen/cli'
export default <IGraphQLConfig>{
schema: 'graphql/schema/schema.graphql',
extensions: {
codegen: <CodegenConfig>{
generates: {
'graphql/schema/schema.graphql': {
schema: 'http://127.0.0.1:8080/graphql',
documents: [],
plugins: ['schema-ast'],
},
},
},
},
} An integration into
export const JsonObject = scalar(`JsonObject`, {
encode: (value) => value,
decode: (value) => value,
})
export type JsonObject = typeof JsonObject
export const Void = scalar(`Void`, {
encode: () => null,
decode: () => null,
})
export type Void = typeof Void
export const client = create({
schema: 'http://localhost:3000/gateway/graphql',
returnMode: 'data',
headers: {
'Content-Type': 'application/json',
},
}).extend(async ({ pack }) => {
return pack({
...pack.input,
headers: {
'Content-Type': 'application/json',
},
})
})
|
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
My last status update in winter introduced the emergence of an opt-in type-safe ts-client layered over a raw mode that comes out of the box (equating to what
graphql-request
is today).#675
I've made progress since then, primarily two things:
The TS client is in a state that is essentially ready for production usage, a first version.
However I want to get the extension system into a state that supports file upload and persisted query use-cases.
After that there are a few odds and ends like being able to generate types from an introspection query (instead of assuming you have access to a
schema.graphql
file). Or the fact that generated runtime code (there is a tiny bit for custom scalar support) are TS files which does not support JS users.When this work is done, the release will launch under a new package name
graffle
.I expect this to happen this year, maybe as early as September, but if not, I'll have a status update in the autumn about what has happened.
Everything I am doing is still in the
graphql-request
package. I welcome any alpha users that want to take the project for a spin.I will also be working on the new docs in
/DOCUMENTATION_NEXT.md
.Mo more features will be shipped for
graphql-request
. All effort will be going into makingGraffle
scale from the minimal client thatgraphql-request
already is, up to the bleeding edge first class TypeScript experiences that I am personally passionate about.Cheers
👋
Beta Was this translation helpful? Give feedback.
All reactions