Closed sibelius closed 5 years ago
thanks, I actually realized that Relay expects or accounts for "data" as the root field of the fetch query response. I was doing response.json().data
. I'll try to get a PR for this issue soon.
@sibelius , using @argumentDeinfitions
in my app now and introduced a new arg
@argumentDefinitions(
count: { type: "Int" },
cursor: { type: "String" },
employerId: { type: "ID!" }) {...
Relay compiler won't compile unless I pass a default even though I'm clearly passing the id here:
export default createQueryRenderer(
EmployerOpeningListPaginationContainer,
EmployerOpeningList,
{
variables: {cursor: null, count: 10, employerId: 1 },
query
}
);
ERROR: RelayCompilerScope: No value found for required argument
$employerId: ID!.
any ideas?
you need to use @arguments as well
@argumentDefinition will create local variables
employerId in your queryRenderer is a global one
...EmployerOpeningList_query @arguments(employerId: $employerId)
ok, nevermind, got it working with adding the arg to the outside query. Yup, you just said it. I still don't understand the global / local thing. Need to stare at this one file... for even longer :0 🍻
we can improve this later on
Is there a breaking change on Relay 1.4 around this? I can't get an nearly identical
UserList.js
to work. I get this as the error. It's not all too clear