You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The ppx could return a wrapped ReasonApollo module, based on bs-config, to make the usage easier from reason-apollo:
moduleAddUser= [%graphql {| ... |} ];
//This could be avoided if the ppx would do this
moduleAddUserMutation=ReasonApollo.CreateMutation(AddUser);
...
<AddUserMutation>
...{(mutation) =><button onClick={()=> {
//This is not obvious, this would also be fixed by providing a tighter coupling
let addNewUserQuery =AddUser.make(~name="Bob", ());
//^^^^^^^^ should I use AddUserorAddUserMutation
mutation(~variables=addNewUserQuery##variables,())
}}> mutate</button>}
</AddUserMutation>
The text was updated successfully, but these errors were encountered:
I think it would make graphql_ppx coupled a lot with reason-apollo.
Another solution would be to provide the type of make function making it possible to alias that function in reason-apollo. That way AddUser would be only used to provide it to CreateMutation/CreateQuery/CreateSubscription and creating variables would be the responsibility of AddUserMutation which would be much cleaner for the users
ylecornec
pushed a commit
to o1-labs/graphql_ppx
that referenced
this issue
Jun 3, 2022
Nice to have:
The ppx could return a wrapped ReasonApollo module, based on bs-config, to make the usage easier from reason-apollo:
The text was updated successfully, but these errors were encountered: