GraphQL Filtering in Injee 0.21.0
Notes
curl -X POST http://localhost:4125/ops/load-data \
-H "Content-Type: application/json" \
-d '{"table": "books", "file": "https://yu7.in/injee-data-books"}' curl -X POST http://localhost:4125/graphql \
-H "Content-Type: application/json" \
-d '{
"query": "query GetAllBooks { books { title author published_at } }"
}'curl -X POST http://localhost:4125/graphql \
-H "Content-Type: application/json" \
-d '{
"query": "query GetAllBooks { books(filter: [{ field: \"title\", op: \"eq\", value: \"The Kite Runner\" }]) { title author } }"
}'curl -X POST http://localhost:4125/graphql \
-H "Content-Type: application/json" \
-d @- <<'EOF' | jq
{
"query": "query GetAllBooks { books(filter: [{ field: \"title\", op: \"startsWith\", value: \"The\" }, { field: \"published_at\", op: \"gte\", value: \"2000-01-01\" }]) { title published_at } }"
}
EOFcurl -X POST http://localhost:4125/graphql \
-H "Content-Type: application/json" \
-d @- <<'EOF' | jq
{
"query": "query GetAllBooks { books(q: \"Hunger\", filter: [{ field: \"title\", op: \"startsWith\", value: \"The\" }, { field: \"published_at\", op: \"gte\", value: \"2000-01-01\" }]) { title published_at } }"
}
EOF