{"library":"lokka-transport-http","title":"Lokka HTTP Transport","description":"Lokka-transport-http provides an isomorphic HTTP transport layer designed for the Lokka GraphQL client. It facilitates sending GraphQL queries over HTTP to `graphql-express` compatible endpoints. The package's current stable version is 1.6.1, with its last release approximately 9 years ago. It supports sending custom HTTP headers and integrates with existing cookie-based authentication mechanisms, or allows for explicit `Authorization` header configuration. A key differentiator is its minimalist approach as a transport layer, allowing Lokka (a simple GraphQL client itself) to focus on query construction. The package, and the broader Lokka ecosystem, appears to be unmaintained, with no recent updates or active development. This means no new features, bug fixes, or security patches are likely. By default, it throws an error on the first GraphQL error returned by the server, but this behavior can be customized.","language":"javascript","status":"abandoned","last_verified":"Wed Apr 22","install":{"commands":["npm install lokka-transport-http"],"cli":null},"imports":["import HttpTransport from 'lokka-transport-http';"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import HttpTransport from 'lokka-transport-http';\nimport Lokka from 'lokka';\n\n// Initialize Lokka with the HTTP transport\nconst client = new Lokka({\n  transport: new HttpTransport('http://graphql-swapi.parseapp.com/')\n});\n\n// Send a simple GraphQL query\nclient.query(`\n    {\n      allFilms {\n        films {\n          title\n        }\n      }\n    }\n`).then(response => {\n    console.log('Query successful:', JSON.stringify(response, null, 2));\n}).catch(error => {\n    console.error('Query failed:', error);\n});\n\n// Example with custom headers (e.g., for authentication)\nconst headers = {\n    'Authorization': `Bearer ${process.env.AUTH_TOKEN ?? ''}`,\n    'x-custom-header': 'some-value'\n};\nconst authenticatedClient = new Lokka({\n    transport: new HttpTransport('http://your-authenticated-graphql-endpoint.com/graphql', { headers })\n});\n\nauthenticatedClient.query(`{ viewer { id } }`)\n  .then(response => console.log('Authenticated query:', response))\n  .catch(error => console.error('Authenticated query failed:', error));","lang":"javascript","description":"This quickstart demonstrates how to set up `lokka-transport-http` with Lokka to query a GraphQL endpoint, including an example of sending custom headers for authentication.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}