Skip to content

shortcake-dev/shortcake-app

Repository files navigation

🍰 Shortcake Flutter App

https://img.shields.io/github/workflow/status/shortcake-dev/shortcake-app/tests/main?label=tests&style=for-the-badge https://img.shields.io/github/workflow/status/shortcake-dev/shortcake-app/linting/main?label=linting&style=for-the-badge https://img.shields.io/coveralls/github/shortcake-dev/shortcake-app?style=for-the-badge

Flutter app for the Shortcake backend

Development

Codegen

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.

  1. 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)
  2. Copy and paste the output to ${SHORTCAKE_APP_DIR}/bin/src/graphql/schema.graphql

  3. Then, generate the code

    flutter pub run build_runner build --delete-conflicting-outputs

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages