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

GraphQL API #51

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

GraphQL API #51

wants to merge 1 commit into from

Conversation

Arcath
Copy link
Contributor

@Arcath Arcath commented Nov 1, 2024

Checklist

  • TypeDef generation
  • Resolver generation
  • API Secret Management
  • API Docs

Summary

This will likely be the breaking change for version 3, running the API under its own container.

This is proving a fun challenge, the typedefs and resolvers need to be dynamically generated. The API is no use to someone if they have to lookup and asset and its fields etc... they want to use their own assets etc...

This will take a fair bit of work, this PR will end up a bit of a notepad

@Arcath Arcath added the enhancement New feature or request label Nov 1, 2024
@Arcath Arcath added this to the Version Next milestone Nov 1, 2024
Copy link

github-actions bot commented Nov 1, 2024

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 13.05% 286 / 2191
🔵 Statements 12.99% 294 / 2262
🔵 Functions 8.58% 54 / 629
🔵 Branches 9.5% 54 / 568
File CoverageNo changed files found.
Generated in workflow #158 for commit 75ff917 by the Vitest Coverage Report Action

@Arcath
Copy link
Contributor Author

Arcath commented Nov 1, 2024

API Keys

API Keys should come in 2 variants.

  1. User generated long lived keys, show once and permission-able.
  2. System generated short lived keys, possibly tied to the session? so the main app can make use of the API.

@Arcath
Copy link
Contributor Author

Arcath commented Nov 1, 2024

Fields

Fields will need a gql handler as well, so that the data can be returned in a gql compatible way.

For example a relation field will need to return an array of IDs that then resolve into objects that match the type. Making the typeDef:

type Laptop {
  id: String
  asset: AssetRegister
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant