Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🚀 Feature: Customize default function "example data" #5716

Open
2 tasks done
byawitz opened this issue Jun 16, 2023 · 1 comment
Open
2 tasks done

🚀 Feature: Customize default function "example data" #5716

byawitz opened this issue Jun 16, 2023 · 1 comment
Assignees
Labels
enhancement New feature or request product / functions Fixes and upgrades for the Appwrite Functions.

Comments

@byawitz
Copy link
Member

byawitz commented Jun 16, 2023

🔖 Feature description

Add the option to set function default example data.

When executing a function from the console, there's the option show example JSON, I think it might my be nice to have this option to fetch some basic JSON the user added to the deployed function.

So for example the appwrite.json will look something like this.

{
  "projectId"  : "someProject",
  "projectName": "General",
  "functions"  : [
    {
      "$id"       : "646b67675406f6ae4388",
      "name"      : "My Awesome Function",
      "runtime"   : "node-16.0",
      "path"      : "functions/My Awesome Function",
      "entrypoint": "src/index.js",
      "ignore"    : [
        "node_modules",
        ".npm"
      ],
      "execute"   : [],
      "events"    : [],
      "example"   : {
        "userName": "John",
        "password": "world",
        "age"     : 26
      },
      "schedule"  : "",
      "timeout"   : 15
    }
  ]
}

Then, the console could load that example - if it exists - and let the user copy it.

image

🎤 Pitch

Many functions have some basic logic that can work many times.
This feature will allow fast debugging of a function.

👀 Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

@joeyouss
Copy link

Thank you for opening this, it would be cool to have this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request product / functions Fixes and upgrades for the Appwrite Functions.
Projects
None yet
Development

No branches or pull requests

3 participants