{"id":23122822,"url":"https://github.com/folio-org/folio-graphiql","last_synced_at":"2025-04-04T04:21:09.083Z","repository":{"id":32578969,"uuid":"136983794","full_name":"folio-org/folio-graphiql","owner":"folio-org","description":"Serves up GraphiQL for use with FOLIO","archived":false,"fork":false,"pushed_at":"2023-10-20T02:52:22.000Z","size":895,"stargazers_count":2,"open_issues_count":2,"forks_count":0,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-02-09T15:42:47.336Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/folio-org.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":"2018-06-11T21:38:53.000Z","updated_at":"2022-02-25T11:39:11.000Z","dependencies_parsed_at":"2024-12-17T07:30:48.884Z","dependency_job_id":"d255dc2d-8053-4385-a918-6930c77c641f","html_url":"https://github.com/folio-org/folio-graphiql","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/folio-org%2Ffolio-graphiql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/folio-org%2Ffolio-graphiql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/folio-org%2Ffolio-graphiql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/folio-org%2Ffolio-graphiql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/folio-org","download_url":"https://codeload.github.com/folio-org/folio-graphiql/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247118950,"owners_count":20886659,"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":[],"created_at":"2024-12-17T07:30:40.254Z","updated_at":"2025-04-04T04:21:09.062Z","avatar_url":"https://github.com/folio-org.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# folio-graphiql\n\nCopyright (C) 2016-2018 The Open Library Foundation\n\nThis software is distributed under the terms of the Apache License,\nVersion 2.0. See the file \"[LICENSE](LICENSE)\" for more information.\n\n----\n\nA simple webapp that lets you authenticate to Okapi and use [GraphiQL](https://github.com/graphql/graphiql) to explore its GraphQL endpoint (provided by [mod-graphql](https://github.com/folio-org/mod-graphql)).\n\nBuilt with [create-react-app](https://github.com/facebook/create-react-app), this is a typical React/Webpack app that requires `nodejs` and `yarn` (or `npm`, probably).\n\nBefore running, you must install dependencies:\n```\nyarn install\n```\n\nYou can run it on `http://localhost:3000` (or elsewhere if you set an [environment variable](https://github.com/facebook/create-react-app/blob/master/packages/react-scripts/template/README.md#advanced-configuration)) with:\n```\nyarn start\n```\n\nOr output optimized files to `./build` that you can host on another server:\n```\nyarn build\n```\n\nIf you would like to change the default Okapi URL in the login form or the text that first populates GraphiQL's query box, that is currently conspicuously hardcoded in [src/App.js](src/App.js).\n\n\n## Using `folio-graphiql`\n\nThe GraphQL syntax can be a bit verbose and not as intuitive as one might hope. This is best demonstrated by examples.\n\n### Simple usage\n\nTo see the titles and alternative titles of many records, set the GraphQL query to:\n```\nquery {\n  instance_storage_instances {\n    totalRecords\n    instances {\n      id title alternativeTitles\n    }\n  }\n}\n```\nWhen you press the play button, you should see something like:\n```\n{\n  \"data\": {\n    \"instance_storage_instances\": {\n      \"totalRecords\": 118,\n      \"instances\": [\n        {\n          \"id\": \"69640328-788e-43fc-9c3c-af39e243f3b7\",\n          \"title\": \"ABA Journal\",\n          \"alternativeTitles\": []\n        },\n        {\n          \"id\": \"6506b79b-7702-48b2-9774-a1c538fdd34e\",\n          \"title\": \"Nod\",\n          \"alternativeTitles\": []\n        },\n        [...]\n```\n\n### Specifying parameters\n\nIn many GraphQL calls, you will also want to provide values for parameters: for example you could pass a CQL string called `query` in the previous example to specify which particular records you want to see. Or to fetch information about a single record, you will need to specify its ID as a value for the `instanceId` parameter. To see record `69640328-788e-43fc-9c3c-af39e243f3b7`, set the GraphQL query to:\n\n```\nquery {\n  instance_storage_instances_SINGLE(instanceId: \"69640328-788e-43fc-9c3c-af39e243f3b7\") {\n    title\n  }\n}\n```\nWhen you press the play button, you should see something like:\n```\n{\n  \"data\": {\n    \"instance_storage_instances_SINGLE\": {\n      \"title\": \"ABA Journal\"\n    }\n  }\n}\n```\n\n### Using variables\n\nOften, insteaad of hardwiring parameter values into your GraphQL query, you will want to provide them separately, as the values of _variables_ which get plugged into the query. For this to work, you need to declare which variables you're going to use and what their types are, which you do in a parenthesized list after the `query` header. So to run the previous query using a variable, set the GraphQL query to:\n```\nquery ($id:String!) {\n  instance_storage_instances_SINGLE(instanceId: $id) {\n    title\n  }\n}\n```\nAnd the query variables (at bottom left on the page) to:\n```\n{\n  \"id\": \"69640328-788e-43fc-9c3c-af39e243f3b7\"\n}\n```\nWhen you press the play button, you should see the same result as before.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffolio-org%2Ffolio-graphiql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffolio-org%2Ffolio-graphiql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffolio-org%2Ffolio-graphiql/lists"}