Flutter app for the Shortcake backend
This project uses Ferry for strongly-typed GraphQL Dart requests and objects. Unfortunately, it requires codegen to function.
The codegen requires the GraphQL schema (that's used in the backend). The current version of the
schema the client is built against is located at bin/src/graphql/schema.graphql
. (In the
future, this may removed in lieu of a better process. Steps 1 and 2 below are optional unless the
upstream schema has been updated.
Get the GraphQL schema.
SHORTCAKE_APP_DIR=$(pwd) git clone https://github.com/shortcake-dev/shortcake.git /tmp/shortcake cd /tmp/shortcake poetry install
Then, run the the following Python code to print the schema
from strawberry.printer import print_schema from shortcake.api.graphql import schema; print_schema(schema)
Copy and paste the output to
${SHORTCAKE_APP_DIR}/bin/src/graphql/schema.graphql
Then, generate the code
flutter pub run build_runner build --delete-conflicting-outputs