{"id":16551208,"url":"https://github.com/michaelcurrin/luke-i-am-your-parent-node","last_synced_at":"2026-05-04T18:32:20.224Z","repository":{"id":93179004,"uuid":"172248429","full_name":"MichaelCurrin/luke-i-am-your-parent-node","owner":"MichaelCurrin","description":"GraphQL wrapper for Star Wars API, written in NodeJS","archived":false,"fork":false,"pushed_at":"2021-02-19T14:30:12.000Z","size":37,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-04T15:47:29.850Z","etag":null,"topics":["graphql","nodejs","starwars","starwars-api","swapi-graphql"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/MichaelCurrin.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":"2019-02-23T18:23:54.000Z","updated_at":"2021-02-19T14:30:15.000Z","dependencies_parsed_at":"2023-04-11T11:01:08.367Z","dependency_job_id":null,"html_url":"https://github.com/MichaelCurrin/luke-i-am-your-parent-node","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/MichaelCurrin/luke-i-am-your-parent-node","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MichaelCurrin%2Fluke-i-am-your-parent-node","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MichaelCurrin%2Fluke-i-am-your-parent-node/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MichaelCurrin%2Fluke-i-am-your-parent-node/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MichaelCurrin%2Fluke-i-am-your-parent-node/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MichaelCurrin","download_url":"https://codeload.github.com/MichaelCurrin/luke-i-am-your-parent-node/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MichaelCurrin%2Fluke-i-am-your-parent-node/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32619526,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-04T10:08:07.713Z","status":"ssl_error","status_checked_at":"2026-05-04T10:08:02.005Z","response_time":58,"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":["graphql","nodejs","starwars","starwars-api","swapi-graphql"],"created_at":"2024-10-11T19:36:37.923Z","updated_at":"2026-05-04T18:32:20.188Z","avatar_url":"https://github.com/MichaelCurrin.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Luke, I Am Your Parent Node\n\u003e GraphQL wrapper around the Star Wars API\n\n[![GitHub tag](https://img.shields.io/github/tag/MichaelCurrin/luke-i-am-your-parent-node)](https://github.com/MichaelCurrin/luke-i-am-your-parent-node/tags/?include_prereleases\u0026sort=semver)\n[![License](https://img.shields.io/badge/License-MIT-blue)](#license)\n\n[![Made with Node.js](https://img.shields.io/badge/Made_with-Node.js-blue.svg?logo=javascript)](https://nodejs.org)\n[![Made with GraphQL](https://img.shields.io/badge/Made_with-GraphQL-blue.svg?logo=graphql)](https://graphql.org)\n\n\n## About\n\nThis is experiment is build a GraphQL API around an existing REST API and then query the GraphQL and print the output. Note that there is no GraphQL server here, but one could be setup using a library.\n\nThis was built around [swapi.co](https://swapi.co/) and now it uses [swapi.dev](https://swapi.dev/), a forked project which has the same or similar API.\n\n\n## Purpose\n\nThe Star Wars API (SWAPI) let's you view data around objects in the Star Wars universe, like vehicles, people and planets.\n\nThis project allows fetching of data from that REST API using the [GraphQL](https://graphql.org/) standard to abstract away the rests.\n\nThis project is built on Node do the queryies and print results.\n\nThis is a simple, fun project and is not meant to be complete or up to date.\n\n\n## Explore the API\n\nThese are accessible in the browser easily using the Django interface.\n\n- https://swapi.dev\n- https://swapi.dev/api/ (API root)\n- https://swapi.dev/api/people/\n- https://swapi.dev/api/planets/\n- https://swapi.dev/api/planets/1/\n- https://swapi.dev/api/starships/9/\n\n\n## Features\n\nAdvantages of this wrapper:\n\n- Select just the fields you need.\n- Combine object type results (e.g. vehicles and planets) below each other in a single query.\n\nA demo script is supplied to test the requests.\n\n\n## Background\n\nI attended an introductory GraphQL workshop at [CodeBridge](https://codebridge.org.za/). An exercise at the end was of the one section was to use [NodeJS](https://nodejs.org/en/) and [graphql-js](https://graphql.org/graphql-js/) to build a GraphQL wrapper around an existing REST API. I decided on the Star Wars API which I'd found before and that used that for this repo.\n\nGraph data is all about _nodes_ and how they relate to each other, hence the title of this project and a variation of a classic line in Star Wars.\n\n\n## Installation\n\n### Install system dependencies\n\nInstall Node.js and NPM - follow [instructions](https://gist.github.com/MichaelCurrin/aa1fc56419a355972b96bce23f3bccba).\n\nClone this repo:\n\n```bash\n$ git clone https://github.com/MichaelCurrin/luke-i-am-your-parent-node.git\n$ cd luke-i-am-your-parent-node\n```\n\n### Install project packages\n\n```bash\n$ npm install\n```\n\n\n## Usage\n\nRun the demo script.\n\n```sh\n$ npm run demo\n```\n\nThis runs [index.js](/src/index.js). It even does nested queries a Films to convert to the Planet URL strings into planet objects.\n\nIt has hardcoded inputs so takes no arguments.\n\nAlso note that the queries are queued up and the URLs logged, then each query response is logged.\n\nSample output, truncated for readability:\n\n```\nRequesting: https://swapi.co/api/planets/1/\n{\n    \"data\": {\n        \"planet\": {\n            \"climate\": \"arid\",\n            \"name\": \"Tatooine\",\n            \"terrain\": \"desert\",\n            \"gravity\": \"1 standard\",\n            \"orbital_period\": \"304\",\n            \"films\": [\n                \"https://swapi.co/api/films/5/\",\n                \"https://swapi.co/api/films/4/\",\n                \"https://swapi.co/api/films/6/\",\n                \"https://swapi.co/api/films/3/\",\n                \"https://swapi.co/api/films/1/\"\n            ],\n            \"residents\": [\n                \"https://swapi.co/api/people/1/\",\n                \"https://swapi.co/api/people/2/\",\n                \"https://swapi.co/api/people/4/\",\n                \"https://swapi.co/api/people/6/\",\n                \"https://swapi.co/api/people/7/\",\n                \"https://swapi.co/api/people/8/\",\n                \"https://swapi.co/api/people/9/\",\n                \"https://swapi.co/api/people/11/\",\n                \"https://swapi.co/api/people/43/\",\n                \"https://swapi.co/api/people/62/\"\n            ]\n        }\n    }\n}\n...\n```\n\n\n## License\n\nReleased under [MIT](/LICENSE) by [@MichaelCurrin](https://github.com/MichaelCurrin).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaelcurrin%2Fluke-i-am-your-parent-node","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmichaelcurrin%2Fluke-i-am-your-parent-node","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaelcurrin%2Fluke-i-am-your-parent-node/lists"}