Uncaught Error: Illegal fetchable type "CustomerData", super class can only be specified for object type but its category is "EMBEDDED"
See original GitHub issueGood brother, this library is very nice, very like to use, but encountered some problems, confused me
This is the relevant screenshot and code
code gen script
import { ApolloGenerator, loadRemoteSchema } from 'graphql-ts-client-codegen';
import { join } from 'path';
// https://github.com/babyfish-ct/graphql-ts-client/blob/master/doc/apollo_zh_CN.md
const generator = new ApolloGenerator({
schemaLoader: async () => {
return loadRemoteSchema(
'https://ininderprint-backend-nestjs.cloud-dev.ininderprint.tw/vendor-api/graphql'
);
},
targetDir: join(__dirname, '../src/gencode') as string,
defaultFetcherExcludeMap: {
// Department: ['avgSalary'],
},
scalarTypeMap: {
String: 'string',
},
});
generator.generate();
graphql req file
import { useTypedQuery } from 'gencode';
import { query$, userProfile$ } from 'gencode/fetchers';
import React from 'react';
export default function Orders() {
const { data, loading, error } = useTypedQuery(
query$.myProfile(
userProfile$.userUuid.nickname.firstName.lastName.gender.birthday.avatar
)
);
return (
<>
{loading && <div style={{ color: 'green' }}>Loading...</div>}
{error && <div style={{ color: 'red' }}>Error</div>}
<div>userUuid: {data?.myProfile.userUuid}</div>
<div>userUuid: {data?.myProfile.nickname}</div>
<div>userUuid: {data?.myProfile.firstName}</div>
<div>userUuid: {data?.myProfile.lastName}</div>
<div>userUuid: {data?.myProfile.gender}</div>
<div>userUuid: {data?.myProfile.birthday}</div>
<div>userUuid: {data?.myProfile.avatar}</div>
</>
);
}
screenshot relate info
Trouble brother,Thank you very much and good luck
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
react-relay Invalid use of @refetchable on fragment
I am learning react-relay (v13) and have a problem specifying a pagination fragment with @refetchable. It ...
Read more >relay-hooks/useRefetchable.md at master - GitHub
You can use useRefetchable when you want to fetch and re-render a fragment with different data: Arguments: They are the same as useFragment....
Read more >useRefetchableFragment - Relay
You can use useRefetchableFragment when you want to fetch and re-render a fragment with different data: import type ...
Read more >Accelerating Data Transformation with IBM DB2 Analytics ...
Use cases that are enabled by accelerator-only tables and in-database ... This IBM Redbooks® publication describes the new table type that is introduced ......
Read more >Search Results - CVE
A security agent directory traversal vulnerability in Trend Micro Apex One and Apex One as a Service could allow a local attacker to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Give me your SDL please
BTW, your fetcher is too longer, you can try to use the default fetcher “userProfile$$”
With the help of the author, the related problem was found, and the corresponding update is in v3.0.9,The document is related to doc, the reason is **my graphql type has union type and this dont have ID **。