{"id":47790,"library":"gqty","title":"GQty","description":"GQty is a No-GraphQL client for TypeScript that auto-generates a fully typed client from your GraphQL schema, eliminating manual query writing. Current stable version is 3.6.0. It uses a proxy-based approach to automatically track data requirements and generate optimal queries. Compared to other clients like Apollo or Urql, GQty removes boilerplate and provides real-time type safety, making it ideal for TypeScript-heavy projects. It ships TypeScript types, supports subscriptions via graphql-ws and SSE via graphql-sse, and has a growing community on Discord.","status":"active","version":"3.6.0","language":"javascript","source_language":"en","source_url":"https://github.com/gqty-dev/gqty","tags":["javascript","typescript"],"install":[{"cmd":"npm install gqty","lang":"bash","label":"npm"},{"cmd":"yarn add gqty","lang":"bash","label":"yarn"},{"cmd":"pnpm add gqty","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency for GraphQL schema and execution utilities.","package":"graphql","optional":false},{"reason":"Peer dependency for WebSocket-based subscriptions.","package":"graphql-ws","optional":false},{"reason":"Peer dependency for Server-Sent Events-based subscriptions.","package":"graphql-sse","optional":false}],"imports":[{"note":"Package is ESM-only; use import syntax.","wrong":"const { createClient } = require('gqty')","symbol":"createClient","correct":"import { createClient } from 'gqty'"},{"note":"Hooks are provided by the separate @gqty/react package.","wrong":"import { useQuery } from 'gqty'","symbol":"useQuery","correct":"import { useQuery } from '@gqty/react'"},{"note":"Subscription functionality is in @gqty/subscriptions package.","wrong":"import { subscribe } from 'gqty'","symbol":"subscribe","correct":"import { subscribe } from '@gqty/subscriptions'"},{"note":"Generated types are local to your project, typically in a './gqty' file.","wrong":"import { Query } from 'gqty'","symbol":"type from generated schema","correct":"import { Query } from './gqty'"}],"quickstart":{"code":"import { createClient } from 'gqty';\n\nconst client = createClient({\n  url: process.env.GRAPHQL_URL ?? 'http://localhost:4000/graphql',\n  // optional: headers, fetch options, etc.\n});\n\n// Example: fetch a query\nconst query = client.query({\n  hello: true\n});\n\nconst data = await query;\n\nconsole.log(data); // { hello: '...' }","lang":"typescript","description":"Shows how to create a GQty client and execute a simple query to fetch a field named 'hello'."},"warnings":[{"fix":"Ensure data access happens within React components or with explicit await on queries.","message":"GQty uses a proxy that tracks property access; lazy evaluation may cause unexpected network requests if you access fields outside of rendering or without caching context.","severity":"gotcha","affected_versions":">=3.0.0"},{"fix":"Use createClient from 'gqty' and @gqty/react for hooks instead of previous monolithic imports.","message":"Version 3.0 introduced a new API with createClient and removed the old createReactClient. Existing code using v2.x must be rewritten.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Replace useMutation with client.mutation() in event handlers or use useTransaction from @gqty/react.","message":"The 'useMutation' hook was removed; mutations are now performed via client.mutation() or the 'useTransaction' hook.","severity":"deprecated","affected_versions":">=3.0.0"},{"fix":"Ensure your GraphQL endpoint is accessible during development and runtime.","message":"GQty requires a running GraphQL server; it does not work with static schema files only unless you use a codegen step.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Install: npm install graphql-ws graphql-sse","message":"Peer dependencies graphql-ws and graphql-sse must be installed manually. Missing them causes runtime errors when using subscriptions.","severity":"breaking","affected_versions":">=3.0.0"}],"env_vars":null,"search_vec":"'3.6.0':31 'apollo':53 'approach':38 'auto':13 'auto-gener':12 'automat':40 'base':37 'boilerpl':58 'client':8,18,51 'communiti':94 'compar':48 'current':27 'data':42 'discord':96 'elimin':23 'fulli':16 'generat':14,45 'gqti':1,2,56 'graphql':7,21,82,88 'graphql-ss':87 'graphql-w':81 'grow':93 'heavi':72 'ideal':68 'javascript':97 'like':52 'make':66 'manual':24 'no-graphql':5 'optim':46 'project':73 'provid':60 'proxi':36 'proxy-bas':35 'queri':25,47 'real':62 'real-tim':61 'remov':57 'requir':43 'safeti':65 'schema':22 'ship':75 'sse':85,89 'stabl':28 'subscript':79 'support':78 'time':63 'track':41 'type':17,64,77 'typescript':10,71,76,98 'typescript-heavi':70 'urql':55 'use':33 'version':29 'via':80,86 'write':26 'ws':83","created_at":"2026-06-07T16:53:19.684494+00:00","updated_at":"2026-06-07T16:53:19.684494+00:00","problems":[{"fix":"Run: npm install gqty","cause":"Missing npm install or incorrect import path.","error":"Cannot find module 'gqty' or its corresponding type declarations."},{"fix":"Upgrade to GQty v3 and use createClient correctly: import { createClient } from 'gqty'","cause":"Using an older version of GQty without the createClient API.","error":"TypeError: client.query is not a function"},{"fix":"Regenerate the client: npx gqty generate","cause":"The GraphQL schema does not contain that field, or the schema has changed and generated code is stale.","error":"Missing field 'any' on type 'Query' in generated gqty file"},{"fix":"Check server logs and ensure your query matches the schema. Use client.$query to inspect the generated query.","cause":"The GraphQL server returned an error, possibly due to invalid query.","error":"Uncaught (in promise) Error: Network error: Response not successful - Received status code 400"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://gqty.dev","github":"https://github.com/gqty-dev/gqty","docs":null,"changelog":null,"pypi":null,"npm":"gqty","openapi_spec":null,"status_page":null,"smithery":null,"categories":["api-client"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}