{"id":49460,"library":"superagent-graphql","title":"superagent-graphql","description":"A small SuperAgent plugin that wraps a GraphQL query (string + variables) into a JSON POST body. Version 0.1.2 is the latest stable release, with no update cadence. It adds a .use() middleware that sets the request body to {query, variables} and ensures the Content-Type is application/json. Unlike full GraphQL clients, this is a minimal helper for SuperAgent users who want to fire a single query without a dedicated client.","status":"active","version":"0.1.2","language":"javascript","source_language":"en","source_url":null,"tags":["javascript","superagent","graphql"],"install":[{"cmd":"npm install superagent-graphql","lang":"bash","label":"npm"},{"cmd":"yarn add superagent-graphql","lang":"bash","label":"yarn"},{"cmd":"pnpm add superagent-graphql","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency; the plugin must be used with a superagent instance","package":"superagent","optional":false}],"imports":[{"note":"The package has no default export; it exports a function directly. Use require or import * as ql for ESM.","wrong":"const ql = require('superagent-graphql').default;","symbol":"ql","correct":"const ql = require('superagent-graphql');"},{"note":"ESM default import works; named import does not. The package does not ship TypeScript types.","wrong":"import { ql } from 'superagent-graphql';","symbol":"ql","correct":"import ql from 'superagent-graphql';"},{"note":"The plugin does not export a named member 'ql'. Always assign the whole required module to a variable.","wrong":"const { ql } = require('superagent-graphql');","symbol":"superagent-graphql","correct":"const request = require('superagent'); const ql = require('superagent-graphql');"}],"quickstart":{"code":"import request from 'superagent';\nimport ql from 'superagent-graphql';\n\nconst query = `\n  query GetUser($id: ID!) {\n    user(id: $id) {\n      name\n      email\n    }\n  }\n`;\nconst variables = { id: '123' };\n\nrequest\n  .post('https://api.example.com/graphql')\n  .use(ql(query, variables))\n  .end((err, res) => {\n    if (err) return console.error(err);\n    console.log(res.body);\n  });","lang":"typescript","description":"Shows how to send a GraphQL POST request using superagent-graphql plugin with query string and variables."},"warnings":[{"fix":"Consider using a modern GraphQL client or building the request manually.","message":"The package appears unmaintained (no updates in years). Latest version is 0.1.2.","severity":"deprecated","affected_versions":">=0.1.0"},{"fix":"Set Content-Type after .use() if you need a different type.","message":"The plugin always sets Content-Type to application/json, overriding any existing header.","severity":"gotcha","affected_versions":"*"},{"fix":"Run npm install superagent alongside superagent-graphql.","message":"Requires superagent as a peer dependency; not installing superagent will cause runtime error.","severity":"gotcha","affected_versions":"*"}],"env_vars":null,"search_vec":"'0.1.2':21 'add':32 'application/json':51 'bodi':19,40 'cadenc':30 'client':55,74 'content':48 'content-typ':47 'dedic':73 'ensur':45 'fire':67 'full':53 'graphql':3,11,54,77 'helper':60 'javascript':75 'json':17 'latest':24 'middlewar':35 'minim':59 'plugin':7 'post':18 'queri':12,42,70 'releas':26 'request':39 'set':37 'singl':69 'small':5 'stabl':25 'string':13 'superag':2,6,62,76 'superagent-graphql':1 'type':49 'unlik':52 'updat':29 'use':34 'user':63 'variabl':14,43 'version':20 'want':65 'without':71 'wrap':9","created_at":"2026-06-07T17:01:53.692337+00:00","updated_at":"2026-06-07T17:01:53.692337+00:00","problems":[{"fix":"npm install superagent-graphql","cause":"Missing npm install of the package.","error":"Cannot find module 'superagent-graphql'"},{"fix":"Use `import ql from 'superagent-graphql'` or `const ql = require('superagent-graphql')`","cause":"Importing incorrectly (e.g., named import instead of default).","error":"TypeError: ql is not a function"},{"fix":"Add `import request from 'superagent'` at the top.","cause":"Forgot to import superagent and use it as request.","error":"Cannot read property 'post' of undefined"}],"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":null,"github":null,"docs":null,"changelog":null,"pypi":null,"npm":"superagent-graphql","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}}