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.

[client-preset] optional `' $fragmentName'` property

See original GitHub issue
export type UserFieldsFragment = { __typename?: 'User', id: string, email: string, fullName: string, displayName: string, provider: AuthProvider, isAdmin: boolean }
  & { ' $fragmentName': 'UserFieldsFragment' };

The following:

{ ' $fragmentName': 'UserFieldsFragment' }

Should be:

{ ' $fragmentName'?: 'UserFieldsFragment' }

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
ZakKa89commented, Oct 13, 2022

Thank you I will try the new client preset. That might also solve this issue https://github.com/dotansimha/graphql-code-generator/issues/8474

1reaction
charlypolycommented, Oct 13, 2022

Hi @ZakKa89,

the following code is found: `tweet: DocumentType

And I don’t understand we can’t just use tweet: TweetFragment

since that type is also available in the generated types, and has the types I need? Does that example help with understanding the question?

The fragment type is wrapped in a TypedDocumentNode<R,V> type, making it impossible to directly extract the inner type (the actual fragment type):

image

So are you I should use client-present over gql-tag-operations? I thought I read somewhere in the docs that gql-tag-operations was the preferred way right now, but can’t find it.

You are right, we only updated the guides for now: https://www.the-guild.dev/graphql/codegen/docs/guides/react-vue We plan to update the doc of gql-tag-operations and deprecate is on npm in the upcoming weeks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

client-preset - GraphQL Code Generator
The client-preset provides typed GraphQL operations (Query, Mutation and Subscription) by perfectly integrating with your favorite GraphQL ...
Read more >
Fragments - Apollo GraphQL Docs
This object maps the name of an interface or union type (the supertype) to the types that implement or belong to it (the...
Read more >
ZakKa89 (ZakKa89) - PullAnswer
ZakKa89 · Can't get graphql-tag-operations to work with server-side apollo query. · [client-preset] optional `' $fragmentName'` property · [client-preset] optional ...
Read more >
S-Index (Oracle Fusion Middleware Java API Reference for ...
A list iterator implementation based on a static array. SafeArrayList.SafeListIterator(int, Object[]) - Constructor for class oracle.javatools.buffer.
Read more >
Difference between object attributes in graphql and sdk - braintree ...
Hi, I wonder if there is a way to retrieve the exact same attribute from ... [client-preset] optional `' $fragmentName'` property 5 open...
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