8000 GitHub - gemini-hlsw/lucuma-schemas: Schemas for lucuma DB · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Jul 30, 2025. It is now read-only.
gemini-hlswPublic archive

About

Schemas for lucuma DB

Resources

Stars

0 stars

Watchers

8 watching

Forks

Latest commit

 

History

1,455 Commits

Folders and files

Repository files navigation

lucuma-schemas

The purpose of this project is to emit an artifact that:

  • Includes the schema files, so that it can be referenced by projects downstream to validate and generate queries.
  • Includes the types generated from those schemas.
  • Is cross compiled for the JVM and JS.

Structure

Project templates

Contains:

  • Schema files in resources (eg: ObservationDB.graphql). They can be updated with fetchODBSchema.mjs. Use the flake.nix with nix develop, and run npm install to use.
  • Templates (eg: ObservationDB.scala) to map schema scalars and other types to Scala types.

Project lucuma-schemas

This is the project that is published.

Contains:

  • Full-fledged generated schema source (using clue's generator), as managed source.
  • Utilities, encoders, decoders, etc. to work with the schema.

Also adds templates's resources as this project's resources, so that schema files are included in the published artifacts.

Usage

In downstream projects using clue, to generate code for queries with scalafix GraphQLGen, the following settings are needed:

  • In build.sbt:
  scalafixDependencies += "edu.gemini" %% "lucuma-schemas" % lucumaSchemasVersion,
  libraryDependencies += "edu.gemini" %% "lucuma-schemas" % lucumaSchemasVersion,

The first line makes the schema file available to the scalafix rule. The second one adds the classes from this project as a regular runtime dependency.

  • In .scalafix.conf:
  GraphQLGen.schemaDirs=["/lucuma/schemas"]

About

Schemas for lucuma DB

Resources

Stars

0 stars

Watchers

8 watching

Forks

Releases

Packages

Used by

Contributors

Languages

0