GithubHelp home page GithubHelp logo

aeiz / student-api-graphql Goto Github PK

View Code? Open in Web Editor NEW
23.0 3.0 9.0 28.8 MB

A GraphQL Wrapper for Ellucian's Banner Student REST API

JavaScript 99.96% Batchfile 0.04%
graphql graphql-server graphql-js nodejs banner ellucian ellucian-banner facebook-dataloader

student-api-graphql's Introduction

student-api-graphql

A GraphQL Wrapper for Ellucian's Banner Student REST API

Build Status

This project's purpose is to aggregate all of the StudentAPI endpoints into a single GraphQL endpoint with intuitive types that are connected via the proper relationships. Using GraphQL to expose the StudentAPI endpoints offers many benefits, however considering it is just a wrapper, many of the limitations of the REST implementation remain.

Disclaimer

This project is a work in progress! This is also just a user-contributed project. I am not affiliated with Ellucian.

Install

git clone https://github.com/aeiz/student-api-graphql.git
cd student-api-graphql
npm install

Configuration

Edit config.js with your own settings.

Config Option Description Default
API_BASE_URL Point to your school's StudentAPI endpoint https://api.university.edu/StudentApi/api
SERVER_PROTOCOL GraphQL Server Protocol (http or https) http
SERVER_ADDRESS GraphQL Server Address localhost
SERVER_PORT GraphQL Server Port Number 3000
CRYPTO_ALGO Crypto Algorithm aes-256-ctr
JWT_SECRET JSON Web Token Secret shhhhh!
JWT_EXPIRE JSON Web Token Expiration Duration (in minutes) 60

Running the GraphQL Server

npm start

Alternatively, if you use want to use forever, there is a wrapper (server.js) to support running babel-node via forever:

forever start server.js

Once the server is started, browse to http://localhost:3000/graphql to use GraphiQL (A graphical interactive in-browser GraphQL IDE).

Authentication

This project relies on the authentication mechanism implemented in the StudentAPI (basic HTTP authentication) application. However, I've exposed a mutation (createAuthenticationToken) that enables authentication through JWTs (JSON Web Tokens). Either can be used.

If you want to use JWTs, here's an example of the GraphQL mutation you would use to retrieve the token:

mutation {
  createAuthenticationToken(username: "username", password:"password") {
    token
    expires
  }
}

Schema

The schema is generated programmatically, but you can view the schema language description by browsing to http://localhost:3000/schema when the server is running. The schema language description is also saved in schema.graphql.

A graph diagram of the schema definition generated by graphqlviz is available here.

You can also view the schema interactively using the GraphQL Voyager tool here.

Documentation of the schema generated via graphql-docs is available here.

Here's an example query:

query {
  personIdentification(bannerId: "bannerId") {
    person {
      names {
        fullName
        firstName
        middleName
        lastName
      }
      dateOfBirth
    }
  }
}

Debug

This project uses debug, which can be enabled by setting the DEBUG environment variable.

Windows:

set DEBUG=*,-babel,-express*

Linux/Mac:

DEBUG=*,-babel,-express*

student-api-graphql's People

Contributors

aeiz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.