Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Asset source gets not transformed when using fragments #3337

Open
jhmen opened this issue Jan 28, 2025 · 0 comments
Open

Asset source gets not transformed when using fragments #3337

jhmen opened this issue Jan 28, 2025 · 0 comments
Labels
type: bug 🐛 Something isn't working

Comments

@jhmen
Copy link

jhmen commented Jan 28, 2025

Describe the bug
When you send a GraphQL Query with fragments on query level, the source attribute gets not transformed.

To Reproduce
Steps to reproduce the behavior:

  1. Send this query to the shop api:
query TestQuery {
    ...TestFragment
    activeOrder {
        ...TestFragment2
    }
}

fragment TestFragment on Query {
    activeOrder {
        active
    }
}


fragment TestFragment2 on Order {
    lines {
        featuredAsset {
            source
        }
    }
}
  1. The source is not transformed and is not a valid URL
  2. Send the Query without the first fragment
query TestQuery {
    activeOrder {
        ...TestFragment2
    }
}

fragment TestFragment2 on Order {
    lines {
        featuredAsset {
            source
        }
    }
}
  1. The source gets transformed
    A clear and concise description of what you expected to happen.

Environment:

  • @vendure/core version: 3.1.1
  • Nodejs version: 22
  • Database (mysql/postgres etc): mariadb

Additional context
I have debugged the asset-interceptor-plugin.ts and found that the type argument in transformValues is undefined, when sending the first query.

@jhmen jhmen added the type: bug 🐛 Something isn't working label Jan 28, 2025
@jhmen jhmen changed the title Asset Source gets not transformt when using fragments Asset Source gets not transformed when using fragments Jan 28, 2025
@jhmen jhmen changed the title Asset Source gets not transformed when using fragments Asset source gets not transformed when using fragments Jan 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug 🐛 Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant