menu button

Chapter 4: Update

Get Agenda Item and Update Depth

This API involves fetching the Agenda item and updates the depth

Agenda items can be fetched by passing the agenda item as a parameter. You can also update the depth of the agenda item by passing the optional depth parameter.


Example Graphql mutation object

    export const GET_AGENDA_ITEM_AND_UPDATE_DEPTH = `
        fragment agendaDetails on ApiAgendaItemType {
            id
            classType
            depth
            metaData
            title
            resolutionList {
                resolution
                decision
            }
            textList
            createdAt
        }

        query getAgendaItemAndUpdateDepthById($agendaItemId:String!){
            getAgendaItemAndUpdateDepthById(agendaItemId:$agendaItemId){
                    ...agendaDetails
            }
        }

    `

Example Graphql mutation object with Depth Updation

        query getAgendaItemAndUpdateDepthById($agendaItemId:String!, $depth: Int!){
                getAgendaItemAndUpdateDepthById(agendaItemId:$agendaItemId, depth: $depth){
                        ...agendaDetails
                }
        }

Example JS code

    import axios from "axios";

    async function updateAgendaItemById(agendaItem) {
        const dataObj = {
            query: GET_AGENDA_ITEM_AND_UPDATE_DEPTH,
            variables: {
                agendaItemId: "<agenda_item_id>",
                depth: 2 //can be between 0 to 2
            },
        };

        return await axios({
            method: "post",
            url: process.env.VUE_APP_GRAPHQL_API,
            data: JSON.stringify(dataObj),
            headers: {
                "Content-Type": "application/json",
                "x-api-key": process.env.VUE_APP_API_KEY,
            },
        })
        .then((response) => {
            const responseData = response.data.data.getAgendaItemAndUpdateDepthById;
        
            return responseData
        })
        .catch((error) => {
            console.log(error);
        })
    }

After running the above query, it returns an object where:

  • The agenda item with the updated depth, if it was passed.

Have questions?

Still have questions? Talk to support.