{"id":18695376,"url":"https://github.com/julianschmuckli/graphql-fitbit","last_synced_at":"2025-06-19T02:36:33.589Z","repository":{"id":57253434,"uuid":"161906147","full_name":"julianschmuckli/graphql-fitbit","owner":"julianschmuckli","description":"This is a node module for handling with GraphQL in Fitbit OS","archived":false,"fork":false,"pushed_at":"2018-12-15T14:21:46.000Z","size":3,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-07T21:36:15.199Z","etag":null,"topics":["fitbit","fitbit-ionic","fitbit-os","fitbit-sdk","fitbit-versa"],"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/julianschmuckli.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}},"created_at":"2018-12-15T13:11:18.000Z","updated_at":"2022-05-12T05:46:45.000Z","dependencies_parsed_at":"2022-08-31T22:11:57.567Z","dependency_job_id":null,"html_url":"https://github.com/julianschmuckli/graphql-fitbit","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/julianschmuckli%2Fgraphql-fitbit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/julianschmuckli%2Fgraphql-fitbit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/julianschmuckli%2Fgraphql-fitbit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/julianschmuckli%2Fgraphql-fitbit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/julianschmuckli","download_url":"https://codeload.github.com/julianschmuckli/graphql-fitbit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239512878,"owners_count":19651313,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["fitbit","fitbit-ionic","fitbit-os","fitbit-sdk","fitbit-versa"],"created_at":"2024-11-07T11:14:45.871Z","updated_at":"2025-02-18T21:44:19.753Z","avatar_url":"https://github.com/julianschmuckli.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GraphQL for Fitbit OS\nThis is a node module for handling with GraphQL in Fitbit OS.\n## Usage\n\nIn order to use this library, you have to develop your app on the command line interface (CLI) and not on [studio.fitbit.com](https://studio.fitbit.com/).\nTo install the library use the following command:\n\n```bash\nnpm install graphql-fitbit\n```\n\nAfter you have installed the library on your project, you can import the library in your project. Just open your `index.js` file in the companion folder and add there the following line below the other imports:\n\n```js\nimport * as graphql from \"graphql-fitbit/companion\";\n```\n\nThen you can call the function everywhere you want. Just make sure that you initalize also the callback function.\n\n```js\n// Example query\nconst query = `{\n  stopPlace(id: \"NSR:StopPlace:6905\") {\n    id\n    name\n    estimatedCalls(startTime:\"2018-12-14T20:00:00+0200\" timeRange: 72100, numberOfDepartures: 10) {\n      expectedDepartureTime\n      destinationDisplay {\n        frontText\n      }\n      quay {\n        id\n      }\n      serviceJourney {\n        journeyPattern {\n          line {\n            id\n            name\n            transportMode\n          }\n        }\n      }\n    }\n  }\n}`;\n\n// Enter in the first place\ngraphql.requestGraphQL('https://api.entur.org/journeyplanner/2.0/index/graphql', query, myCallback);\n\nfunction myCallback(data){\n  console.log(data); // Here you have the data in JSON format.\n}\n```\n\nUnfortunately Fitbit uses the gulp uglify library, which does not allow to use async functions.\n\n## API\n```\ngraphql.requestGraphQL(url, query, callback, debug);\n```\nSends a request to the GraphQL URL and responds with the callback.\n- `url`: GraphQL endpoint url\n- `query`: GraphQL query in a string\n- `callback`: Callback function where the response can be send to\n- `debug`: If you want detailed information about the request (default: false)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjulianschmuckli%2Fgraphql-fitbit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjulianschmuckli%2Fgraphql-fitbit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjulianschmuckli%2Fgraphql-fitbit/lists"}