Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@genql/cli

Package Overview
Dependencies
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@genql/cli - npm Package Compare versions

Comparing version 5.0.0 to 5.0.1

dist/utils.d.ts

4

dist/tasks/clientTasks.js

@@ -18,3 +18,3 @@ "use strict";

const listr2_1 = require("listr2");
const camelCase_1 = __importDefault(require("lodash/camelCase"));
const utils_1 = require("../utils");
const files_1 = require("../helpers/files");

@@ -124,3 +124,3 @@ const renderClient_1 = require("../render/client/renderClient");

ctx.addCodeBlock(enums
.map((type) => `export const ${(0, camelCase_1.default)('enum' + type.name)} = {\n` +
.map((type) => `export const ${'enum' + (0, utils_1.capitalize)((0, utils_1.camelCase)(type.name))} = {\n` +
type

@@ -127,0 +127,0 @@ .getValues()

{
"name": "@genql/cli",
"version": "5.0.0",
"version": "5.0.1",
"description": "Generate a TypeScript SDK for any GraphQl API",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

<div align='center'>
<br/>
<br/>
<img src='https://genql.dev/banner.jpg' width='420px'>
<img src='https://genql.dev/banner.png' width='380px'>
<br/>

@@ -17,14 +17,19 @@ <br/>

🔥 **Features**
**Features**
- Type completion & Type validation
- No dependencies
- Easily fetch all scalar fields in a type
- Works with any client (Apollo, Relay, etc)
- Works in browser, Node, Deno, Cloudflare workers, Bun and more
- ✅ Type completion & Type validation
- 🍃 No dependencies (not even graphql)
- ⚡️ [Can easily fetch all scalar fields in a type](https://genql.dev/docs/usage/fetch-all-fields-on-a-type)
- 🐎 [Works with any client (Apollo, Relay, etc)](https://genql.dev/docs/usage/integrate-with-other-graphql-clients)
- 🥃 [Support for Subscriptions](https://genql.dev/docs/usage/subscriptions)
- 🔋 [Built in batching support](https://genql.dev/docs/usage/batching-queries)
- ↔️ [Easy migrate existing GraphQL queries to Genql code](https://genql.dev/converter)
- 🚂 Works in browser, Node, Deno, Cloudflare workers, Bun and more
## Example
First generate your client executing
First generate your client with the `genql` cli.
> You can find other cli options [here](https://genql.dev/docs/cli-reference)
```sh

@@ -80,3 +85,3 @@ npm i -D @genql/cli # cli to generate the client code

Genql has a lot of benefits over other writing graphql queries by hand:
Genql has a lot of benefits over writing graphql queries by hand:

@@ -86,3 +91,3 @@ - Writing queries is faster thanks to TypeScript auto completion

- You can fetch all scalar fields in a type with `__scalar: true`
- No `graphql` package dependency
- No `graphql` package dependency, no runtime parsing of queries
- You have to generate the client only after your schema changes, not after every query change

@@ -89,0 +94,0 @@

import { GraphQLSchema, GraphQLEnumType, isEnumType } from 'graphql'
import { ListrTask, Listr } from 'listr2'
import camelCase from 'lodash/camelCase'
import { camelCase, capitalize } from '../utils'
import { Config } from '../config'

@@ -148,3 +148,5 @@ import { ensurePath, writeFileToPath } from '../helpers/files'

(type) =>
`export const ${camelCase('enum' + type.name)} = {\n` +
`export const ${
'enum' + capitalize(camelCase(type.name))
} = {\n` +
type

@@ -151,0 +153,0 @@ .getValues()

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc