question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow wildcard fields in FragmentReplacement

See original GitHub issue

Assuming I have the following GraphQL type:

type AudioListen implements Activity {
  id: ID!
  user: User!
  audio: Audio!
}

I’d like to be able to add a wildcard FragmentReplacement

export const fragmentReplacements: FragmentReplacement[] = [
  {
    field: '*',
    fragment: '... on AudioListen { user { id } }',
  },
];

So that the user ID is always fetched if any of the fields are fetched.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
maticzavcommented, Dec 18, 2020

Each rule accepts a fragment option that you may use to specify which fields it relies on. Based on where you use the rule, graphql-shield will generate the fragment replacement that you later forward to server.

Check out the docs here

0reactions
stale[bot]commented, Apr 16, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Find strings within strings faster with the new wildcard field
In Elasticsearch 7.9, we'll be introducing a new “wildcard” field type optimised for quickly finding patterns inside string values.
Read more >
Query all fields of a type in a simple expression [wildcard] #127
Let us say this is the type : type Human { id: String name: String homePlanet: String } Then to query all the...
Read more >
Elasticsearch - Highlight of Wildcard Search - Stack Overflow
Pure wildcards \* are rewritten to exists queries for efficiency. As a consequence, the wildcard "field:*" would match documents with an ...
Read more >
SQL Server: Replace with wildcards?
The REPLACE built-in function does not support patterns or wildcards; only LIKE and PATINDEX do. Assuming that you really just want the ...
Read more >
Wildcards in Java - GeeksforGeeks
The wildcard can be used in a variety of situations such as the type of a parameter, field, or local variable; sometimes as...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found