Skip to content
No description, website, or topics provided.
Ruby Other
  1. Ruby 99.5%
  2. Other 0.5%
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
app
bin
cider-ci
config
datalayer @ c53a083
lib/tasks
log
public
scripts
spec
storage
test
tmp
vendor
.gitignore
.gitmodules
.graphqlconfig
.rspec
.rubocop.yml
.ruby-version
Gemfile
Gemfile.lock
README.md
Rakefile
cider-ci.yml
config.ru
db
package-lock.json
package.json

README.md

Madek GraphQL API

⚠️ STATUS: EXPERIMENTAL, WORK IN PROGRESS ⚠️

cute cartoon cat typing on laptop

#goals

  • GraphQL API for Sets, Entries, Metadata, Previews (e.g. enough data for a Lightbox gallery)
  • read-only data (only query, no mutation)
  • only public data (no auth, no access control except the get_* fields)
  • no hard dependencies on other parts of Madek except read-only access
    • (local development environment shares some code like DB migrations)
  • fully tested with RSpec (maybe turnip?)
    • test data in db + query + variables => expect result
    • schema, incl. backwards compat tracking
    • perf testing? (relative query runtime?)
  • performance: should be fast enough to render gallery of 100 photos in set server-side and retain reasonable loading time
    • efficient batching / pagination
    • (SQL) query optimization
  • basic "evil" query protection (maximum depth, timeouts)

reading material:

development setup

install

git clone https://github.com/Madek/madek-graphql-api && cd madek-graphql-api
git submodule update --recursive --init --force
./scripts/bundle

initial config

cd datalayer
cp config/database_developer_example.yml config/database.yml
# edit config/database.yml
cd -

reset db && startup

./scripts/dev-reset
PORT=4321 ./scripts/start-dev-server

helpers

example queries

query {
  mediaEntry(id: "06622f9c-8f41-43eb-a4a4-fd3b8444de64") {
    id
    createdAt
    title
  }
}

=>

{
  "data": {
    "mediaEntry": {
      "id": "06622f9c-8f41-43eb-a4a4-fd3b8444de64",
      "createdAt": "2012-10-16 13:57:54 UTC",
      "title": "Diplom"
    }
  }
}
You can’t perform that action at this time.