request.query does not print the query in Fastify (querystring)

I searched for ages, but it just wouldn’t print the query, I’ve no idea what I should do. I’m also kind of new to Fastify. Also I’m sending the request to

const opts = {
  schema: {
    querystring: {
      type: 'object',
      required: ['greeting'],
      properties: {
        greeting: {type: 'string'},

    response: {
      200: {
        type: 'object',
        properties: {
          status: {type: 'object'}, // i've abosulutely no idea what the type should be

  handler: async (request, reply) => {
      status: request.query,

Can someone please help me in resolving this ?


Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

You don’t see the request.query output because of the response’s schema.

The response schema filters out all the fields that are not defined, so the properties field lists the status key as object without any properties.

You should change it to:

status: { type: 'object', additionalProperties: true }

or adding the greetings property.

You can read about it here:

All methods was sourced from or, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Notify of

Inline Feedbacks
View all comments
Would love your thoughts, please comment.x