@mondaydotcomorg/setup-api
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

Monday API Setup Library

Overview

This library automates the setup of a development environment for working with the Monday API using GraphQL. It's designed to help developers quickly start projects with pre-configured tools and settings.

What does the script do?

The script gets the environment ready for graphql api development

  • Installs the following npm packages: @graphql-codegen/cli @graphql-codegen/typescript @graphql-codegen/typescript-operations
  • Adds configuration file for codegen (used to create types for queries and mutations) at the root folder - codegen.yml
  • Adds configuration file for the graphql extension at the root folder - graphql.config.yml - to be used with the official graphql extensions
  • Adds queries folder used to write your queries and mutations - src/queries.graphql.ts
  • Adds a script to get the latest api schema - fetch-schema.sh
  • Adds scripts to package.json to run with your graphql api

How do I work now?

After everything will be set up, you should follow those steps:

  1. Write your queries in the queries.graphql.ts file
  2. Run 'npm run fetch:schma'
  3. your types will be ready to use (as can be seen in the src/generated folder)

Installation

Run this command on the root directory of your project

npx @mondaydotcomorg/setup-api 

Using the newly created scripts

After installation, you will have 3 new scripts:

  • "fetch:schema" - Gets the monday api schema
  • "codegen" - generates types
  • "fetch:generate" - runs both

for now do the following to get the schema and create your first type.

npm run fetch:generate

Installing the GraphQL Extension for your IDE

Visual Studio Code

To enhance your development experience with GraphQL, we recommend installing the GraphQL extension for Visual Studio Code. This extension provides syntax highlighting, linting, auto-complete, and more.

To install the extension, open Visual Studio Code, go to the Extensions view by clicking on the square icon on the sidebar or pressing Ctrl+Shift+X, and search for GraphQL. Find the extension by GraphQL Foundation and click Install.

Alternatively, you can install the extension via the command line:

code --install-extension GraphQL.vscode-graphql

Or you can simply go to extensions and add the official graphql extensions (GraphQL: Language Feature Support, GraphQL: Syntax Highlighting)

JetBrains IDEs

JetBrains IDEs such as WebStorm or IntelliJ IDEA support GraphQL development through plugins. To install a GraphQL plugin, follow these steps:

  1. Open your IDE and go to Preferences > Plugins.
  2. Click the Marketplace tab and search for GraphQL.
  3. Find the plugin provided by JetBrains and click Install.
  4. Restart your IDE if prompted.

This plugin provides features such as syntax highlighting, documentation lookup, and schema-aware code completion.

What You Should Know

This library simplifies the initial configuration for working with the Monday API, but you should still familiarize yourself with the GraphQL schema and the Monday API documentation to make the most out of your development experience.

We hope this library helps you kickstart your project with the Monday API more efficiently. Happy coding!

Example usage

When using this package, you will automatically get an example query and an example mutation in your queries file. Here is how to use them!

const client = new ApiClient("your_api_token"); // From the monday api sdk @mondaydotcomorg/api

const queryVariables: QueryBoardsArgs = { ids: ["your_board_id"] }; // replace with your board id
const queryData = await client.query<GetBoardsQuery>(exampleQuery, queryVariables);

const mutationVariables: CreateItemMutationVariables = {
boardId: "your_board_id", // replace with your board id
groupId: "your_groyup_id", // replace with your group id
itemName: "Im using my own queries!",
};
const mutationData = await client.query<CreateItemMutation>(exampleMutation, mutationVariables);

Further configuration

you can also add advanced options for you work environment, for example you can add configuration to add react hooks out of your queries (@graphql-codegen/typescript-react-query) in two ways:

  • Install the config that best suits you by adding it manually OR
  • Run npm i --save-dev @graphql-codegen/cli
  • Run graphql-codegen init
  • Choose the config that best suits you

Readme

Keywords

Package Sidebar

Install

npm i @mondaydotcomorg/setup-api

Weekly Downloads

79

Version

1.0.2

License

MIT

Unpacked Size

15.3 kB

Total Files

10

Last publish

Collaborators

  • barosen
  • aviel_hershkovitz
  • mayabarkan
  • leelakr
  • matanmaman
  • benjaminla
  • jz-dapulse
  • tomkoch
  • awallace327
  • byohay-monday
  • adirh
  • michalbel
  • apoorvparijat
  • cezaryla
  • moro256
  • saritka
  • orila
  • adi_braha
  • eyalle
  • alexjalba
  • amitmazor37
  • filip-daca-monday
  • musayedah
  • avivgi
  • idanor
  • kubakolybacz
  • chensar
  • ephraimgr
  • michaelvamonday
  • lotanyuran
  • litalw
  • yoavte
  • ramhillel
  • piotrdu-monday
  • nirfrid
  • dorbi
  • guymevorachlevy
  • gioraguatmonday
  • sandeepkmonday
  • bernardpo-monday
  • ornu-monday
  • shanmonday
  • shayo-ar
  • srdjan-monday
  • miller21
  • shirazbehar2
  • galko_monday
  • danielga-monday
  • orelco2
  • mikeynagler1990
  • yair_engel
  • romkadria
  • vasilykl
  • yanivzi
  • yotamhermes
  • noasharvit
  • morpa-monday
  • tomhousman
  • kfir_bekhavod
  • galspmonday
  • michallor
  • yuvalgr
  • omrial
  • ronavmonday
  • yahorzh
  • shaharzi
  • jakubso2749
  • dorsimm
  • idanga
  • michaelimas
  • adva-gonsh
  • urielwasyng
  • jakubmo
  • tomerzlo
  • przemyslawb
  • eviatharm
  • josephsamonday
  • leonidkr
  • moshe-samson
  • monday-grahamla
  • talsoffer
  • yuvalkahana
  • ofirnirmnd
  • nicole_kezlik
  • arnonrgo
  • dekelabe
  • erlich75
  • idofinder
  • nirarazi.monday
  • ronniemi
  • vikas-monday
  • gabika
  • nirco96
  • barakbs
  • amirdana115
  • chirayu11
  • shaikatzz
  • sergeytsibulnik
  • joshpe-monday
  • guykoren
  • saarar
  • asaf472monday
  • natanrolnik_mnd
  • barja
  • asafsw
  • samwi
  • talkor
  • yuliagoldberg
  • dviryo
  • giladsc
  • giladar-monday
  • asafro
  • talp1
  • tducasse
  • sevmonday
  • kapusj
  • avilevi
  • danielep
  • adigab
  • yosia1990
  • yonatanbi-monday
  • isabelleta
  • eladna-monday
  • admonsa
  • piotrboruc
  • benha
  • adirhaziz2
  • jr-monday
  • mohamedig
  • ronco99
  • rangr-monday
  • omerra
  • olegsh_monday
  • navele
  • maor-monday
  • dord2
  • theido
  • giladtsmonday
  • rzmnd
  • yossisaadi.monday
  • naors
  • guymarushchenko
  • idit-barak
  • mitzafon-monday
  • ericfel
  • billing-guy
  • kirilne
  • adiknafo
  • daniel-glazer
  • alexkubica_monday
  • lukasz-dudzinski
  • ibukunol
  • ak2140
  • eladdo
  • yonatanel
  • edogr1
  • doniawa
  • lihibm
  • tom-katz
  • dipro-monday
  • orier
  • eden-eitani
  • tomaszlamonday
  • jessbemonday
  • shlomito
  • tsemachli
  • tomerst
  • talshe
  • talharari
  • naorbemonday
  • liorl-monday
  • doron.brikman
  • benmamonday
  • mayais
  • igorcz
  • omergrin
  • yavgenypa
  • marcinko-monday
  • maor-barazani
  • galkl
  • gal_finger_monday
  • shayal
  • aviv_go
  • alonbrimer
  • maciej-monday
  • shoshany
  • ronov1
  • orcomonday
  • amitco
  • oded_by_monday
  • johhh_monday
  • alonschatz
  • meromco
  • jeandavid
  • dor-cohen
  • matanla
  • moriat
  • banueldo
  • andreihryhoryeu
  • raneldan
  • idanmonday
  • lironam
  • monday_dan_plusone
  • itaymndy
  • nadavav
  • harelcohen
  • liortalmonday
  • orihassid2507
  • gregra81
  • arielmonday
  • benymonday
  • talibl.monday
  • yoni-alaluf
  • neomi_shavit
  • ran-haveshush-monday
  • kamie
  • marekpe
  • ibmonday
  • gilby1
  • netta-s
  • lotemkirsh
  • asif_monday
  • anyatchernishov
  • neilmon
  • marszelun-monday
  • safaaeek
  • lukaszfiszer-monday
  • arekze-monday
  • rongabbay
  • ethans-monday
  • rankupmonday
  • omernave1
  • lahavp
  • chenbe
  • adamfloor
  • andrey-palman
  • shlomiatmonday
  • m-binygal
  • tomgr
  • adamru-monday
  • etgarmon
  • thierryguy
  • rachelika
  • dudu1982
  • rama-ron
  • alonsadan
  • hadasco
  • ilyastoliar
  • yairfe
  • nitzanezra
  • itamarte
  • mickey_monday
  • nirro.monday
  • liors619
  • yoavga
  • lueran
  • rami-monday
  • maya-assayag
  • liorla13
  • eran-cohen
  • eitante
  • ofirc-monday
  • ssddnode
  • sergeyroyt
  • alonbehaim
  • sergeybr
  • virtser
  • shaharfreidenberg
  • alexanderbarkin
  • alonsh2904
  • eilonmo
  • liorrabin
  • avifreege
  • danofir
  • shanee
  • ronipardo
  • ofirmonsingo
  • monadav
  • guygo
  • boazj
  • annaso
  • venturamd
  • shalomsteinbach
  • ronicohen123
  • mickael_first
  • jonaonmonday
  • guyasino
  • dotansh
  • bladepop
  • anatkatz
  • uri-shmueli
  • shaiet
  • roniav
  • ivankmonday
  • goralth
  • doryehuda
  • udidoron
  • mayaheilbrun
  • itaycohen
  • dorshaked
  • benpi
  • yuvalb
  • tzvico-monday
  • shahafmelamed
  • ronachmany-monday
  • noamn3k
  • itamargold
  • gal_liberman
  • dorhason
  • amit_hanoch
  • yuval-eliav
  • tootmoran
  • sergeisa
  • ozkama
  • mateuszwo
  • illyayu
  • freak4pc
  • barcohen2
  • amirbardugo
  • yuly-roberman
  • sebastian-curland-mndy
  • orrgottl
  • nirlachman
  • matanyaw2
  • igor_budi
  • eviathar
  • darmonday
  • yosefw
  • tomerfriedman
  • oronmonday
  • nik-savchenko
  • lorin-totah
  • idoyana-monday
  • etaylib
  • barakbe
  • yonil
  • tombog
  • saharb
  • oronmeller
  • navecohen
  • liran-brimer-monday
  • idohay
  • danielle.ah
  • ayelet-monday
  • yglaubach
  • tal.haramati
  • sagilinshits
  • oriba
  • liorshamian
  • danielb-bladepop
  • aviv_go_npm
  • yardenli
  • danielab
  • aviram
  • shirza
  • sagiba800
  • or-nuri-monday
  • moshik
  • liormed
  • eran.huberman
  • csaloman
  • avihayav
  • af8811
  • witold-monday
  • shirawe
  • rutikevesh
  • omermonday
  • moshe1100
  • liorke
  • ella-mi
  • christopher-nowak
  • vladmonday
  • shayelmodnay
  • rotemta
  • ohadhege
  • hadaspe
  • elisiegel
  • chezkibotwinick
  • aviel_monday
  • adarmonday
  • vitalim
  • shanibenaderetmonday
  • ofirnavara
  • laviomri
  • antonru92