Add '?' and '=' characters to query string
You declare query parameters in drupal routes in a mymodule.routing.yml file like this:

mymodule.mailcommitter:
  path: '/mailcheck/{uid}'
  defaults:
    _controller: '\Drupal\mymodule\Controller\ProfilController::checkMailCommit'
    _title: 'commit mail'
  options:
      query:
        token: ""
  requirements:
    _permission: 'access content'


Then, you build an url by route like so

'url' =&gt; Url::fromRoute('mymodule.mailcommitter', ['uid' =&gt; 1], ['query' =&gt; ['token' =&gt; 'hello']])


Also check this doc: https://www.drupal.org/docs/8/api/routing-system/parameters-in-routes/using-parameters-in-routes