Tiny GraphQL client library (2.0.0) that converts tagged template literals into executable query functions. Minimal implementation (~15 lines) with no dependencies, ideal for small projects or when avoiding heavy clients like Apollo. Last updated in 2018; stable but experimental status. Differentiates by extreme size and simplicity, but lacks advanced features like caching or subscriptions.
npm install nanographqlNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows creating a GraphQL query using tagged template literal and using it with fetch.
Upgrade to v2 if using older version.
Use JSON.stringify on the result before sending.
Always call the query function with variables object.
Ensure your query strings are syntactically correct.
Inline fragments into the query string.
Use `const gql = require('nanographql')` instead of `const { gql } = require('nanographql')`.Write `gql`...`` (tagged template literal) instead of `gql('...')`.Use `JSON.stringify(body)` when setting the request body.
No dependency data recorded yet.