{"id":15130208,"url":"https://github.com/danstarns/talk-to-graphql","last_synced_at":"2026-01-20T03:01:31.370Z","repository":{"id":256502867,"uuid":"855500689","full_name":"danstarns/talk-to-graphql","owner":"danstarns","description":"Example using gqlpt to speak plain text to any GraphQL api with generated types","archived":false,"fork":false,"pushed_at":"2024-12-07T17:16:59.000Z","size":113,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-05T19:38:44.210Z","etag":null,"topics":["ai","anthropic","cli","generation","github-api","graphql","openai","text","to","translate","typegen","typesafe","typescript"],"latest_commit_sha":null,"homepage":"https://www.gqlpt.dev","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/danstarns.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-11T01:05:04.000Z","updated_at":"2024-12-07T17:17:02.000Z","dependencies_parsed_at":"2024-09-11T06:19:53.607Z","dependency_job_id":"c6237317-9a94-4b4c-ad3d-a59dfd3f3f5c","html_url":"https://github.com/danstarns/talk-to-graphql","commit_stats":null,"previous_names":["danstarns/talk-to-graphql"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/danstarns/talk-to-graphql","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danstarns%2Ftalk-to-graphql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danstarns%2Ftalk-to-graphql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danstarns%2Ftalk-to-graphql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danstarns%2Ftalk-to-graphql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danstarns","download_url":"https://codeload.github.com/danstarns/talk-to-graphql/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danstarns%2Ftalk-to-graphql/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28594958,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-20T02:08:49.799Z","status":"ssl_error","status_checked_at":"2026-01-20T02:08:44.148Z","response_time":117,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","anthropic","cli","generation","github-api","graphql","openai","text","to","translate","typegen","typesafe","typescript"],"created_at":"2024-09-26T02:42:06.369Z","updated_at":"2026-01-20T03:01:31.356Z","avatar_url":"https://github.com/danstarns.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Talk to GraphQL with GQLPT\n\nThis repository demonstrates the usage of GQLPT (GraphQL Plain Text) to query a GraphQL API using natural language. It uses the GitHub GraphQL API as an example.\n\n\u003e You can swap between local and remote examples in the retrospective dir in src.\n\n## Setup\n\n1. Clone this repository:\n\n   ```\n   git clone https://github.com/danstarns/talk-to-graphql\n   cd talk-to-graphql\n   ```\n\n2. Install dependencies:\n\n   ```\n   npm install\n   ```\n\n3. Create a `.env` file in the root directory with the following content:\n\n   ```\n   // For using the remote example\n   GQLPT_URL=\"https://api.github.com/graphql\"\n   GQLPT_HEADERS='{\"Authorization\": \"Bearer YOUR_GITHUB_PERSONAL_ACCESS_TOKEN\"}'\n\n   // Required for both local and remote examples\n   OPENAI_API_KEY=\"YOUR_OPENAI_API_KEY\"\n   GQLPT_ADAPTER=\"openai\"\n\n\n   // Required for using RAG Vector example\n   NEO4J_URI=\"bolt://localhost:7687\"\n   NEO4J_USER=\"neo4j\"\n   NEO4J_PASSWORD=\"password\"\n   ```\n\n   Replace `YOUR_GITHUB_PERSONAL_ACCESS_TOKEN` with your actual GitHub Personal Access Token and `YOUR_OPENAI_API_KEY` with your OpenAI API key.\n\n## Usage\n\n1. Generate types:\n\n   ```\n   npm run generate:remote // or :local\n   ```\n\n   This command will generate TypeScript types based on the GraphQL schema.\n\n2. Run the application:\n   ```\n   npm run start:remote // or :local\n   ```\n   This will execute the remote script, which demonstrates querying the GitHub GraphQL API using plain text.\n\n## What the Code Does\n\nThe main script (`remote.ts`) does the following:\n\n1. Sets up a GQLPT client using the GitHub GraphQL API URL and your OpenAI API key.\n2. Defines two functions:\n   - `getLatestGraphQLIssue()`: Retrieves the latest issue from the graphql/graphql-js repository.\n   - `getGraphQLStarCount()`: Fetches the star count of the graphql/graphql-js repository.\n3. In the `main()` function, it calls both of these functions and logs the results.\n\n## Customization\n\nFeel free to modify the plain text queries in the `getLatestGraphQLIssue()` and `getGraphQLStarCount()` functions to experiment with different queries to the GitHub GraphQL API.\n\n## Troubleshooting\n\nIf you encounter any issues:\n\n- Ensure all environment variables in the `.env` file are set correctly.\n- Check that your GitHub Personal Access Token has the necessary permissions.\n- Verify that your OpenAI API key is valid and has sufficient credits.\n\nFor any other problems, please open an issue in this repository.\n\n## License\n\n[MIT License](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanstarns%2Ftalk-to-graphql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanstarns%2Ftalk-to-graphql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanstarns%2Ftalk-to-graphql/lists"}