#I need code review, anyone help? thx

47 messages ยท Page 1 of 1 (latest)

lavish saddle
ripe jackal
#

I could take a look at the project tomorrow if it is still relevant

lavish saddle
#

yeah, cool... thanks !

#

when run- npm run dev, it gives a "application error"

ripe jackal
lavish saddle
#

thank you, I'm gonna check and also I need add some other things. I'll inform to u later,

#

thanks again ๐Ÿ™‚

ripe jackal
#

no worries ๐Ÿ™‚ I hope the changes make sense ๐Ÿคž Keep us posted how it goes ๐Ÿ™‚

lavish saddle
#

hey, again, did u pull whole client codes and put inside the index.tsx?

#

I add commit on github, I just wanted to understad ๐Ÿ™‚

ripe jackal
# lavish saddle I add commit on github, I just wanted to understad ๐Ÿ™‚

I am afraid I cannot see the comment on GH :/ Would you be able to share a link with me?
I can see there is another PR opened and his approach should be working as well ๐Ÿค”
The blog he posted is a "recent" one about how to add apollo to remix but It also lookd a bit messier than my proposal.

I would recommend you to try out both approaches and try to figure out what the difference is between the two.

lavish saddle
#

yes yes ๐Ÿ™‚

#

another friend add PR, I read and try both of them

#

alright, my question is, why did you take whole client codes and put in the index.tsx

#

I just wonder that logic?

#

don't get me wrong,i just curious, I didnt enough knowledge

#

and the other thing you add some notes like: I would keep this file to the default implementation, what do u mean "default implementation" ?

ripe jackal
# lavish saddle and the other thing you add some notes like: I would keep this file to the defa...

I only meant by that that I wouldn't necessarily touch that file, I would keep it as it was.
I cannot recall what remix generates for us in that file, but based on the added code I the file it is a very simple component. As their documentation states it, you can of course add client side code there but the _index file feels more natural to use also this file is the entry point of the server to the "client" and the hydration happens from this file.

ripe jackal
lavish saddle
#

alright you're right, thanks. I also tried but there is an issue :/

#

here is my query:
import { gql } from "@apollo/client";

const GetCountries = gql query GetCountries { countries { name native capital emoji currency languages { code name } } };

export default GetCountries;
and import the index.tsx (remix)
import GetCountries from "../queries/countries.graphql";

const { data, loading, error } = useQuery(GetCountries);
but got an error like this : : Argument of type 'string' is not assignable to parameter of type 'DocumentNode | TypedDocumentNode<any, OperationVariables>'.
I was expecting DocumentNode | TypedDocumentNode<any, OperationVariables>, but you passed string.

ripe jackal
#

I am not sure if I am 100% right, this is just my perception and approach I haven't used remix for a while.

lavish saddle
#

okey, this is my 1st ๐Ÿ™‚

#

any idea?

ripe jackal
#

let me see, just a sec

#

Could you share a branch or PR with the code in it?

#

It looks like that separating the query and importing it causing some kind of issue.

#

Which is weird.

lavish saddle
#

hmm, how can I open PR ? hmm 1sec, I'll try

#

this is not working well right now but I'll push

ripe jackal
#

alright, that would work too

#

let me know when it's done, then I'll pull your repo

lavish saddle
#

last commit, I guess I didnt do it well

#

:/

ripe jackal
#

Alright so the problem was that you had a countries.graphql file

lavish saddle
#

hmm

ripe jackal
#

When you import that file using the import statement you grabbed the file's path which is a string

#

you need to make that file as a ts or js file then you will be able to import the query correctly

lavish saddle
#

yes

ripe jackal
#

Made a screenshot of the file, its extension, the error is gone and the imported type is correct.

lavish saddle
#

alright, it works ๐Ÿ™‚ thank you

ripe jackal
#

awesome ๐Ÿ™‚

lavish saddle
#

which theme are u using?

ripe jackal
#

I think it's night owl