graphql icon indicating copy to clipboard operation
graphql copied to clipboard

How to define struct

Open Ignorant-lxf opened this issue 1 year ago • 2 comments

Hi,I wanna to invoke an graphql api,but the request body about struct is too long! I need help for how to define struct like thie:

mutation {
    createShoppingProducts( 
        adId: "12345678", 
        shoppingProducts: [
            {
                id: "P11", 
                title: "New Earpods", 
                description: "Noise cancellation enabled earpods", 
                price: {
                    amount: "111.5", 
                    currency: "USD"
                }, 
                availability: "in stock", 
                condition: "Used", 
                link: "https://xxx.com"
            }
        ]
    ) {
        response {
            id
            title
            price {
                amount
            }
        }
        errors {
            id
            field
            messages
            warnings
            originalValue
        }
    }
}

Look forward to reply!

Ignorant-lxf avatar May 19 '23 02:05 Ignorant-lxf