GenQL dependency removed

By
You no longer need to learn a new concept to write GraphQL queries and mutations and instead you can now write plain/vanilla GraphQL.

“Less is more”, that is why providing simplicity in our product is part of our goals. With our latest change we are making it simple to write GraphQL queries and mutations on Custom Resolvers. 

How are we doing this?. You no longer need to learn a new concept to write GraphQL queries and mutations and instead you can now write plain/vanilla GraphQL.

CLI

Since we removed the external dependency with the GenQL CLI, the gen:types command is no longer required and was replaced with the new pull:schema command. Make sure you consider this and update any automation you may have.

  1. Update CLI version:

    1 2 3 yarn global add @composabase/cli or npm install -g @composabase/cli
  2. Remove previously generated code

    1 rm -f src/graphql/generated
  3. Execute new command to pull schema

    1 composabase pull:schema

Custom Resolvers

  1. Remove GenQL devDependency

    1 "@genql/cli": "^6.1.0",
  2. Update SDK devDependency:

    1 "@composabase/sdk": "^0.5",
  3. Add new devDependencies
    1. GraphQL client

      1 "@urql/core": "^4.2.3",
    2. Support for node 20.x

      1 "tsx": "^4.7.1",
  4. Update the start script. Make sure your start looks like this:

    1 "start": "tsx -r tsconfig-paths/register src/index.ts"
  5. Update custom resolvers converting any GenQL Code to vanilla GraphQL see examples below:
    1. Selectionset

      changelog-selection-set.png
    2. Query
changelog-query-01.png
changelog-query-02.png
changelog-query-03.png
changelog-query-04.png


Need help

If you have Custom Revolvers and have questions about this update do not hesitate contacting us.

 

 

Share with others

This website uses cookies to provide you with a better user experience. For more information, please read our Privacy Policy.