Skip to content

DiFronzo/OpenLibrary-GraphQL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


OpenLibrary-GraphQL

Search books using work, edition and ISBN with OpenLibrary API using a backend (Deno and GraphQL).

OL-GQL version deno version license code size

⚡️ Quick start

First of all, download and install Deno. Version 1.10 or higher is required.

Verify that the installation was successful by running the following command that should return the version number for Deno, v8 and TypeScript.

deno --version

To quickly start using the code run the following command. With the flag --allow-net that is allowing network access.

deno run --allow-net https://raw.githubusercontent.com/DiFronzo/OpenLibrary-GraphQL/main/mod.ts

GraphQL should now be running on http://localhost:8080/graphql.

That's all you need to know to start! 🎉

⚙️ Usage & Options

Find books by ISBN

The function findBookISBN is used to find books by ISBN. The id need to be a float. With GraphQL you can choose what result should be returned. Use the DOCS tab on the right side for available parameters.

query
{
  findBookISBN (id: 9780140328721) {
    title
    authors {
      key
    }
  }
}

Find books by edition

The function findBook is used to find books by using the edition slug. The id need to be a string. With GraphQL you can choose what result should be returned. Use the DOCS tab on the right side for available parameters.

query
{
  findBook (id: "OL24981637M") {
    title
    by_statement
    publish_date
  }
}

Find works

The function findWork is used to find work using the works slug. A work is a logical collection of similar editions. The id need to be a string. With GraphQL you can choose what result should be returned. Use the DOCS tab on the right side for available parameters.

query
{
  findWork (id: "OL81613W") {
    description
    type {
      key
    }
  }
}

Find authors

The function findAuthor is used to find an author by using the authors slug. The id need to be a string. With GraphQL you can choose what result should be returned. Use the DOCS tab on the right side for available parameters.

query
{
  findAuthor (id: "OL576769A"){
    name
    personal_name
    alternate_names
    remote_ids {
      wikidata
    }
  }
}

Demo at this url but you need to also change the url in the editor to the same.

🐳 Docker-way to quick start

If you don't want to install OpenLibrary-GraphQL to your system, you feel free to using the following Docker image to run GraphQL from isolated container.

docker run -d --init -p 8080:8080 difronzo/openlibrary-graphql:latest

⭐️ Project assistance

If you want to say thank you or/and support active development of OpenLibrary-GraphQL:

⚠️ License

OpenLibrary-GraphQL is free and open-source software licensed under the MIT. This is not an offical release from Open Library. Use on your own risk.

About

Search for books using work, edition or ISBN with Open Library API. Deployed using Deno and GraphQL.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published