Giter Club home page Giter Club logo

nationalarchives.tdr-generated-graphql's Introduction

TDR Generated GraphQL

This project generates, packages and deploys the case classes generated by the sbt-graphql project to the sonatype nexus.

These classes are used by other TDR repositories to communicate with the consignment API.

Building locally

  1. Add a new query file to src/main/graphql:
  2. Run sbt graphqlSchemaGen in the consignment api project. This will generate a schema.graphql file in the target/sbt-graphql directory
  3. Copy this schema.graphql file
  4. Switch back to the generated-graphl repo
  5. Paste the file into the src/main/resources directory
  6. Run the following commands to allow you to check that your changes work locally before submitting them:

Scala version

  • sbt package publishLocal

This will place a snapshot version of the built project jar in the local .ivy cache folder: $HOME/.ivy2/local/uk.gov.nationalarchives/tdr-generated-graphql_2.13/[version number]-SNAPSHOT

Other sbt projects that have this project as a dependency can access the local snapshot version by changing the version number in their build.sbt file, for example:

... other dependencies...
"uk.gov.nationalarchives" %% "tdr-generated-graphql" % "[version number]-SNAPSHOT"
... other dependences...

Typescript version

The following commands create a symbolic link to the generated Typescript version of the schema.

  1. In this project: cd ts
  2. In the ts directory: npm run codegen
  3. In the ts directory: npm link
    • From the output of this command copy the following line: @nationalarchives/tdr-generated-graphql.
  4. Navigate to the project that uses the generated schema in its Typescript code. In this project navigate to the relevant npm directory and run this command in that directory: npm link @nationalarchives/tdr-generated-graphql

See the following blog post for more information on npm link and instructions to undo the symbolic link: https://medium.com/@alexishevia/the-magic-behind-npm-link-d94dcb3a81af

Releasing

  • Commit and push the new query file that sits in src/main/graphql
  • Open a pull request, and merge to master once it has been reviewed.
  • This project should be run manually in Jenkins.

To Run Jenkins Manually

  • Go to the TDR Graphql Code Generation job in Jenkins.
  • Click on 'Build with parameters'
  • Leave STAGE option as 'intg' and paste the schema from the consignemnt api repo into the SCHEMA section.
  • You can look at the console output when/after you run the jenkins build to help bug fix etc.

TDR Documentation

The full documentation for the TDR project can be found here

nationalarchives.tdr-generated-graphql's People

Contributors

dependabot[bot] avatar lholbourn avatar mancuniansam avatar snyk-bot avatar suzannehamilton avatar techncl avatar tna-digital-archiving-jenkins avatar tomjking avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.