{"id":18401,"library":"graphqlify","title":"graphqlify","description":"A JavaScript library (v1.2.0, last updated 2016) for building GraphQL queries programmatically using plain JavaScript objects. Allows dynamic query construction with support for aliases, arguments, and enums via the Enum helper. Lightweight and dependency-free, but not actively maintained. Differentiated from template-based builders by its object-oriented approach, but lacks support for fragments, directives, or variables typical of modern alternatives like graphql-request or graphql-tag.","status":"maintenance","version":"1.2.0","language":"javascript","source_language":"en","source_url":"https://github.com/kadirahq/graphqlify","tags":["javascript","graphql"],"install":[{"cmd":"npm install graphqlify","lang":"bash","label":"npm"},{"cmd":"yarn add graphqlify","lang":"bash","label":"yarn"},{"cmd":"pnpm add graphqlify","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Default export is the main query builder function.","symbol":"default (graphqlify function)","correct":"import graphqlify from 'graphqlify'"},{"note":"Named export for creating enum values in query arguments.","symbol":"Enum","correct":"import { Enum } from 'graphqlify'"},{"note":"CJS requires .default to access the default export.","wrong":"const graphqlify = require('graphqlify')","symbol":"default via require","correct":"const graphqlify = require('graphqlify').default"}],"quickstart":{"code":"import graphqlify, {Enum} from 'graphqlify';\n\nconst query = graphqlify({\n  characters: {\n    alias: 'heroes',\n    params: { kind: Enum('HUMAN') },\n    fields: {\n      name: {},\n      homePlanet: {}\n    }\n  }\n});\n\nconsole.log(query);","lang":"javascript","description":"Demonstrates building a GraphQL query with alias, argument, and enum using graphqlify."},"warnings":[{"fix":"Migrate to graphql-request for a more complete GraphQL client.","message":"This package is no longer actively maintained. Consider using graphql-request or graphql-tag for modern projects.","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"Use const graphqlify = require('graphqlify').default;","message":"Using CJS require without .default returns an object with default property instead of the function.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use the 'alias' key for aliases, not 'field'.","message":"Aliasing with 'alias' field inside a field object may not be documented properly; some users attempt 'field' for naming.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Always add fields: {} for simple fields without subfields.","message":"Empty fields object {} required for leaf fields; omitting it may cause undefined behavior.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"npm install graphqlify@1.2.0","cause":"Package not installed or using unsupported Node version (no longer maintained).","error":"Cannot find module 'graphqlify'"},{"fix":"const graphqlify = require('graphqlify').default;","cause":"Using CJS require without .default.","error":"TypeError: graphqlify is not a function"},{"fix":"Ensure each field has a proper fields object or alias.","cause":"Object structure missing required fields (e.g., field, params).","error":"Uncaught TypeError: Cannot read property 'fields' of undefined"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}