postmanlabs / postman-app-support

Postman is an API platform for building and using APIs. Postman simplifies each step of the API lifecycle and streamlines collaboration so you can create better APIs—faster.
https://www.postman.com
5.82k stars 839 forks source link

Environment Variable should override Collection Variable #12874

Open kirkmadera opened 4 months ago

kirkmadera commented 4 months ago

Is there an existing issue for this?

Describe the Issue

An environment variable should override a collection variable, but is failing to do so in this case.

Steps To Reproduce

  1. Collection graphQlUrl variable is set to "{{baseUrl}}/graphql".
  2. Environment baseUrl variable is set to "https://warranty-backend-xxxx.local-rmgmedia.com"
  3. Environment graphQlUrl variable is set to "https://warranty-backend-xxxx.local-rmgmedia.com/admin/graphql"
  4. When I use the graphQlUrl variable as the URL for the query, it resolves to "https://warranty-backend-xxxx.local-rmgmedia.com/graphql" which is the result of "{{baseUrl}}/graphql".

It should instead resolve to "https://warranty-backend-xxxx.local-rmgmedia.com/admin/graphql"

Screenshots or Videos

Collection graphQlUrl variable: image

Environment graphQlUrl variable: image

Environment baseUrl variable: image

However, it is still trying to post to the value produced by "{{baseUrl}}/graphql": image

If I replace the variable URL with a string, it works: image

Operating System

Windows

Postman Version

11.1.0

Postman Platform

Postman App

User Account Type

Signed In User

Additional Context?

No response

kirkmadera commented 4 months ago

This might make the issue more clear. Postman is using a different URL to post to than it is posting to

image

What it SHOULD be doing image