title: Retrofit default query parameter
body: <p>I have an apikey &quot;token&quot; that has to be provided as a query parameter in every request.
  How can i setup retrofit as to always include this query parameter in the request?</p>
  <p>I am currently providing the token as a default parameter:</p>
  <pre><code>interface CompanyService {
  
      @GET(&quot;accounts/{id}&quot;)
      fun getCompany(
              @Path(&quot;id&quot;) id: Number,
              @Query(&quot;token&quot;) token: String = Constants.TOKEN) &lt;---- here
              : Call&lt;CompanyResponse&gt;
  
      @GET(&quot;accounts/&quot;)
      fun getCompanies(
          @Query(&quot;id&quot;) page: String,
          @Query(&quot;limit&quot;) limit: Int,
          @Query(&quot;sort&quot;) sort: String = &quot;id&quot;,
          @Query(&quot;token&quot;) token: String = Constants.TOKEN) &lt;---- here
              : Call&lt;CompanyListResponse&gt;
  }
  </code></pre>
  <p>But since i know that every request requires the same token, it feels redundant to have to provide it as a default parameter in every request function i create. How can i setup retrofit to decorate every outgoing request with a default query parameter?</p>
  <p>This is how i build the retrofit2 instance:</p>
  <pre><code>class CompanyAPI {
      companion object {
          private var retrofit: Retrofit? = null
          val client:Retrofit get() {
              if (retrofit == null) {
                  retrofit=Retrofit.Builder()
                      .addConverterFactory(GsonConverterFactory.create())
                      .baseUrl(Constants.BASE_URL)
                      .build()
              }
              return retrofit!!
          }
      }
  }
  </code></pre>
  <p>I would think that you would add some additional function call in the call chain before calling .build() but looking at the available functions i can't say i see anything that would provide this functionality.</p>