spring-petclinic / spring-petclinic-graphql

PetClinic Example based on GraphQL
Other
212 stars 123 forks source link

Incorrect Package Name #5

Closed ikuser closed 2 years ago

ikuser commented 6 years ago

package org.springframework.samples.petclinic.service; Change this to - package org.springframework.samples.petclinic.repository;

Please add me to this project contributor. I would like to contribute.

arey commented 6 years ago

Hi @ikuser you could contribute with a pull request :)

ikuser commented 6 years ago

Hi Antonie,

I need some help in setting my work-space.

There are some error I am seeing, due to apollo-client 2.0+ version update and other git code versions.

Current Git source is using 1.4 (apollo client), and upgrading any package ( Typescript, React etc ) is breaking other code and compilation errors.

Do you please think, can I call you and video share to help me setup this new GraphQL stack - frontend code.

Also, I need some info on how to make new pull request for me to contribute.

I can be reached at - 848 248 1634 or please give me your number/time I will call you then please.

Thank you

Imran.


From: Antoine Rey notifications@github.com Sent: Tuesday, February 13, 2018 1:22 PM To: spring-petclinic/spring-petclinic-graphql Cc: ikuser; Mention Subject: Re: [spring-petclinic/spring-petclinic-graphql] Incorrect Package Name (#5)

Hi @ikuserhttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fikuser&data=02%7C01%7C%7C9021eceef00f44969edf08d5730ec88e%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636541429683348569&sdata=45bbvNt2WnwV0nQ8BwlPeR%2FlJneGvAi1M5LPfQ4Cm0Q%3D&reserved=0 you could contribute with a pull request :)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fspring-petclinic%2Fspring-petclinic-graphql%2Fissues%2F5%23issuecomment-365357358&data=02%7C01%7C%7C9021eceef00f44969edf08d5730ec88e%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636541429683348569&sdata=F%2FUtOQbaO8KZDUq4dlpMDWWKkmdh3reWKKZ3UBmMqSU%3D&reserved=0, or mute the threadhttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FABU8BPuogRUVUEb8G80ixdDG1nlE_dYOks5tUdLzgaJpZM4SEIJl&data=02%7C01%7C%7C9021eceef00f44969edf08d5730ec88e%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636541429683348569&sdata=gE%2Bbpqw6nEv3yM0NihFqyZr6OT3lo%2F9zndPhgm1xk8w%3D&reserved=0.

arey commented 6 years ago

Hi Imran,

I don't understand what problems you are facing: apollo client upgrade? setting the project workspace in your IDE? Do you have any Skype account to call you? For my part, I don't know GraphQL. @nilshartmann is the main contributor of this project. @nilshartmann do you plan to upgrade appolo client version? The GitHub pull request guide is available here: https://help.github.com/articles/about-pull-requests/

Regards

Antoine

ikuser commented 6 years ago

Hi Antoine,

First I want to thank you all. What you guys have shared and knowledge everybody get from your

sharing the code repo is really good.

My Skype id is : ikusa786 or add via my email (ik_usa@hotmail.com).

Normally I never use Skype, but let me know the day/time and I will be available ( preferably evening

EST after 5:00 pm, regular work hours).

Info on below question....

Also attaching compilation error file:

--- I don't understand what problems you are facing: apollo client upgrade? setting the project workspace in your IDE?

  ----- apollo client upgrade? Yes, if I upgrade apollo client ( to 2.0 +) and also React JS ( types and other version from 15-16). Those types break the code, and there are some changes in Apollo client connection mechanism that needs to be modified as well.

 ----- setting the project workspace in your IDE?   ---- Yes, I think i will need some info on setting work-space for GraphGl server part. Though for last 2 days i reverted (NodeJS packages )to version what is currently in Git, but i think that GraphGL server configuration is incorrect, which is giving me compilation error

Here are some pieces I have identified, This is based on comparison between,

https://github.com/spring-petclinic/spring-petclinic-reactjs https://github.com/spring-petclinic/spring-petclinic-graphql

I think graphql - is little more proper updated version, of the code. Basically some logic or those profiling during execution, test case Abstract class execution, DB (init, execution, configuration options) etc is little bit missing(or little different) in regular reactjs project (which uses REST).

The part is I am also new to GraphGL. And I clearly see the benefit of using it, but due to lack of knowledge and setup issue I have to switch to REST and migrate in slower pace to GraphGL. Also I need to understand the setup in Cloud for GraphGL part.

Please help me in GraphGL local workspace setup (if u can). I would love to see what I can add from my side.

Thank you Imran.


From: Antoine Rey notifications@github.com Sent: Thursday, February 15, 2018 4:34 AM To: spring-petclinic/spring-petclinic-graphql Cc: ikuser; Mention Subject: Re: [spring-petclinic/spring-petclinic-graphql] Incorrect Package Name (#5)

Hi Imran,

I don't understand what problems you are facing: apollo client upgrade? setting the project workspace in your IDE? Do you have any Skype account to call you? For my part, I don't know GraphQL. @nilshartmannhttps://github.com/nilshartmann is the main contributor of this project. @nilshartmannhttps://github.com/nilshartmann do you plan to upgrade appolo client version? The GitHub pull request guide is available here: https://help.github.com/articles/about-pull-requests/

Regards

Antoine

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/spring-petclinic/spring-petclinic-graphql/issues/5#issuecomment-365872115, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ABU8BGCaGwEg3Ty6J81P8R-LxHqETBzZks5tU_okgaJpZM4SEIJl.

Error:(42, 72) TS2345:Argument of type '({ mutate, history }: AddOwnerPageProps) => Element' is not assignable to parameter of type 'CompositeComponent<ChildProps<RouteComponentProps<{}>, AddOwnerMutation>>'. Type '({ mutate, history }: AddOwnerPageProps) => Element' is not assignable to type 'StatelessComponent<ChildProps<RouteComponentProps<{}>, AddOwnerMutation>>'. Types of parameters '0' and 'props' are incompatible. Type 'RouteComponentProps<{}> & { data?: (QueryProps & Partial) |...' is not assignable to type 'AddOwnerPageProps'. Type 'RouteComponentProps<{}> & { data?: (QueryProps & Partial) |...' is not assignable to type '{ mutate: MutationFunc<AddOwnerMutation, OperationVariables>; }'. Types of property 'mutate' are incompatible. Type 'MutationFunc<AddOwnerMutation, OperationVariables> | undefined' is not assignable to type 'MutationFunc<AddOwnerMutation, OperationVariables>'. Type 'undefined' is not assignable to type 'MutationFunc<AddOwnerMutation, OperationVariables>'. C:\myfiles\delete\spring-petclinic-graphql\frontend\src\app\domain\owner\UpdateOwnerPage\UpdateOwnerPage.tsx Error:(61, 3) TS2345:Argument of type 'ComponentClass<Pick<RouteComponentProps, never>>' is not assignable to parameter of type 'ReactFunctionOrComponentClass<{ owner: OwnerDetailsFragment; }>'. Type 'ComponentClass<Pick<RouteComponentProps, never>>' is not assignable to type 'StatelessComponent<{ owner: OwnerDetailsFragment; }>'. Type 'ComponentClass<Pick<RouteComponentProps, never>>' provides no match for the signature '(props: { owner: OwnerDetailsFragment; } & { children?: ReactNode; }, context?: any): ReactElement | null'. Error:(65, 7) TS2345:Argument of type '({ owner, history, match, mutate }: UpdateOwnerFullPageProps) => Element' is not assignable to parameter of type 'CompositeComponent<ChildProps<UpdateOwnerPageProps, UpdateOwnerMutation>>'. Type '({ owner, history, match, mutate }: UpdateOwnerFullPageProps) => Element' is not assignable to type 'StatelessComponent<ChildProps<UpdateOwnerPageProps, UpdateOwnerMutation>>'. Types of parameters '0' and 'props' are incompatible. Type 'RouteComponentProps & { owner: OwnerDetailsFragment; } & { data?: (Qu...' is not assignable to type 'UpdateOwnerFullPageProps'. Type 'RouteComponentProps & { owner: OwnerDetailsFragment; } & { data?: (Qu...' is not assignable to type '{ mutate: MutationFunc<UpdateOwnerMutation, OperationVariables>; }'. Types of property 'mutate' are incompatible. Type 'MutationFunc<UpdateOwnerMutation, OperationVariables> | undefined' is not assignable to type 'MutationFunc<UpdateOwnerMutation, OperationVariables>'. Type 'undefined' is not assignable to type 'MutationFunc<UpdateOwnerMutation, OperationVariables>'. C:\myfiles\delete\spring-petclinic-graphql\frontend\src\app\domain\owner\withOwnerFromRouteParams.tsx Error:(41, 6) TS2345:Argument of type '(props: OwnerPageFullProps) => Element' is not assignable to parameter of type 'CompositeComponent<ChildProps<RouteComponentProps, OwnerQuery>>'. Type '(props: OwnerPageFullProps) => Element' is not assignable to type 'StatelessComponent<ChildProps<RouteComponentProps, OwnerQuery>>'. Types of parameters 'props' and 'props' are incompatible. Type 'RouteComponentProps & { data?: (QueryProps & Partial<Ow...' is not assignable to type 'OwnerPageFullProps'. Type 'RouteComponentProps & { data?: (QueryProps & Partial<Ow...' is not assignable to type '{ data: QueryProps & OwnerQuery; owner: OwnerDetailsFragment; }'. Property 'owner' is missing in type 'RouteComponentProps & { data?: (QueryProps & Partial<Ow...'. C:\myfiles\delete\spring-petclinic-graphql\frontend\src\app\domain\pet\AddPetPage\AddPetPage.tsx Error:(31, 15) TS2322:Type '{ typeId: number; ownerId: number; name: string; birthDate: string; type: number; }' is not assignable to type 'AddPetInput'. Object literal may only specify known properties, and 'type' does not exist in type 'AddPetInput'. Error:(60, 66) TS2345:Argument of type '({ mutate, history, data }: AddPetPageProps) => Element' is not assignable to parameter of type 'CompositeComponent<ChildProps<AddPetPageOwnProps, AddPetMutation>>'. Type '({ mutate, history, data }: AddPetPageProps) => Element' is not assignable to type 'StatelessComponent<ChildProps<AddPetPageOwnProps, AddPetMutation>>'. Types of parameters '0' and 'props' are incompatible. Type 'RouteComponentProps<{}> & { data: QueryProps & GetAddPetFormDataQuery; } & { ...' is not assignable to type 'AddPetPageProps'. Type 'RouteComponentProps<{}> & { data: QueryProps & GetAddPetFormDataQuery; } & { ...' is not assignable to type '{ mutate: MutationFunc<AddPetMutation, OperationVariables>; }'. Types of property 'mutate' are incompatible. Type 'MutationFunc<AddPetMutation, OperationVariables> | undefined' is not assignable to type 'MutationFunc<AddPetMutation, OperationVariables>'. Type 'undefined' is not assignable to type 'MutationFunc<AddPetMutation, OperationVariables>'. C:\myfiles\delete\spring-petclinic-graphql\frontend\src\app\domain\pet\UpdatePetPage\UpdatePetPage.tsx Error:(20, 7) TS2322:Type '{ formTitle: string; initialPet: { type: number; id: number; name: string; birthDate: string; own...' is not assignable to type 'IntrinsicAttributes & PetFormProps'. Type '{ formTitle: string; initialPet: { type: number; id: number; name: string; birthDate: string; own...' is not assignable to type 'PetFormProps'. Types of property 'initialPet' are incompatible. Type '{ type: number; id: number; name: string; birthDate: string; owner: { id: number; lastName: strin...' is not assignable to type 'PetData'. Property 'id' does not exist on type 'PetData'. Error:(29, 15) TS2322:Type '{ petId: number; typeId: number; name: string; birthDate: string; type: number; }' is not assignable to type 'UpdatePetInput'. Object literal may only specify known properties, and 'type' does not exist in type 'UpdatePetInput'. Error:(50, 75) TS2345:Argument of type '({ mutate, history, formData }: UpdatePetPageProps) => Element' is not assignable to parameter of type 'CompositeComponent<ChildProps<UpdatePetPageOwnProps, UpdatePetMutation>>'. Type '({ mutate, history, formData }: UpdatePetPageProps) => Element' is not assignable to type 'StatelessComponent<ChildProps<UpdatePetPageOwnProps, UpdatePetMutation>>'. Types of parameters '0' and 'props' are incompatible. Type 'RouteComponentProps<{}> & { formData: GetUpdatePetFormDataQuery; } & { data?: (QueryProps<Operati...' is not assignable to type 'UpdatePetPageProps'. Type 'RouteComponentProps<{}> & { formData: GetUpdatePetFormDataQuery; } & { data?: (QueryProps<Operati...' is not assignable to type '{ mutate: MutationFunc<UpdatePetMutation, OperationVariables>; }'. Types of property 'mutate' are incompatible. Type 'MutationFunc<UpdatePetMutation, OperationVariables> | undefined' is not assignable to type 'MutationFunc<UpdatePetMutation, OperationVariables>'. Type 'undefined' is not assignable to type 'MutationFunc<UpdatePetMutation, OperationVariables>'. C:\myfiles\delete\spring-petclinic-graphql\frontend\src\app\domain\pet\UpdatePetPage\withUpdatePetFormData.tsx Error:(33, 6) TS2345:Argument of type '(props: WrapperComponentProps) => Element' is not assignable to parameter of type 'CompositeComponent<ChildProps<RouteComponentProps<{ ownerId: string; petId: string; }>, GetUpdate...'. Type '(props: WrapperComponentProps) => Element' is not assignable to type 'StatelessComponent<ChildProps<RouteComponentProps<{ ownerId: string; petId: string; }>, GetUpdate...'. Types of parameters 'props' and 'props' are incompatible. Type 'RouteComponentProps<{ ownerId: string; petId: string; }> & { data?: (QueryProps<OperationVariable...' is not assignable to type 'WrapperComponentProps'. Type 'RouteComponentProps<{ ownerId: string; petId: string; }> & { data?: (QueryProps<OperationVariable...' is not assignable to type '{ data: QueryProps & GetUpdatePetFormDataQuery; }'. Types of property 'data' are incompatible. Type '(QueryProps & Partial) | undefined' is not assignable to type 'QueryProps & GetUpdatePetFormDataQuery'. Type 'undefined' is not assignable to type 'QueryProps & GetUpdatePetFormDataQuery'. Type 'undefined' is not assignable to type 'QueryProps'. C:\myfiles\delete\spring-petclinic-graphql\frontend\src\app\domain\specialty\SpecialtiesPage\SpecialtiesPage.tsx Error:(152, 37) TS2345:Argument of type '{ variables: { input: { name: string; }; }; update: (proxy: DataProxy, { data }: ApolloExecutionR...' is not assignable to parameter of type 'MutationOpts'. Types of property 'update' are incompatible. Type '(proxy: DataProxy, { data }: ApolloExecutionResult) => void' is not assignable to type 'MutationUpdaterFn<{ [key: string]: any; }> | undefined'. Type '(proxy: DataProxy, { data }: ApolloExecutionResult) => void' is not assignable to type 'MutationUpdaterFn<{ [key: string]: any; }>'. Types of parameters '1' and 'mutationResult' are incompatible. Type 'ApolloExecutionResult<{ [key: string]: any; }>' is not assignable to type 'ApolloExecutionResult'. Types of property 'data' are incompatible. Type '{ [key: string]: any; } | undefined' is not assignable to type 'AddSpecialtyMutation | undefined'. Type '{ [key: string]: any; }' is not assignable to type 'AddSpecialtyMutation | undefined'. Type '{ [key: string]: any; }' is not assignable to type 'AddSpecialtyMutation'. Property 'addSpecialty' is missing in type '{ [key: string]: any; }'. Error:(172, 28) TS7031:Binding element 'data' implicitly has an 'any' type. Error:(175, 26) TS7006:Parameter 'error' implicitly has an 'any' type. Error:(192, 3) TS2345:Argument of type '{}' is not assignable to parameter of type 'ReactFunctionOrComponentClass'. Type '{}' is not assignable to type 'StatelessComponent'. Type '{}' provides no match for the signature '(props: TargetComponentProps & { children?: ReactNode; }, context?: any): ReactElement | null'. C:\myfiles\delete\spring-petclinic-graphql\frontend\src\app\domain\specialty\SpecialtiesPage\SpecialtyEditor.tsx Error:(76, 24) TS2322:Type 'HTMLInputElement | null' is not assignable to type 'HTMLInputElement | undefined'. Type 'null' is not assignable to type 'HTMLInputElement | undefined'. C:\myfiles\delete\spring-petclinic-graphql\frontend\src\app\domain\vet\VetListPage\VetListPage.tsx Error:(43, 3) TS2345:Argument of type '(props: VetListPageProps) => Element' is not assignable to parameter of type 'CompositeComponent<ChildProps<RouteComponentProps<{}>, VetsQuery>>'. Type '(props: VetListPageProps) => Element' is not assignable to type 'StatelessComponent<ChildProps<RouteComponentProps<{}>, VetsQuery>>'. Types of parameters 'props' and 'props' are incompatible. Type 'RouteComponentProps<{}> & { data?: (QueryProps & Partial) | undefi...' is not assignable to type 'VetListPageProps'. Type 'RouteComponentProps<{}> & { data?: (QueryProps & Partial) | undefi...' is not assignable to type '{ data: QueryProps & VetsQuery; }'. Types of property 'data' are incompatible. Type '(QueryProps & Partial) | undefined' is not assignable to type 'QueryProps & VetsQuery'. Type 'undefined' is not assignable to type 'QueryProps & VetsQuery'. Type 'undefined' is not assignable to type 'QueryProps'. C:\myfiles\delete\spring-petclinic-graphql\frontend\src\app\domain\visit\AddVisitPage\AddVisitPage.tsx Error:(60, 72) TS2345:Argument of type '({ data, mutate, history, match }: AddPetPageProps) => Element' is not assignable to parameter of type 'CompositeComponent<ChildProps<AddVisitPageOwnProps, AddVisitMutation>>'. Type '({ data, mutate, history, match }: AddPetPageProps) => Element' is not assignable to type 'StatelessComponent<ChildProps<AddVisitPageOwnProps, AddVisitMutation>>'. Types of parameters '0' and 'props' are incompatible. Type 'RouteComponentProps<{ ownerId: string; petId: string; }> & { data: QueryProps...' is not assignable to type 'AddPetPageProps'. Type 'RouteComponentProps<{ ownerId: string; petId: string; }> & { data: QueryProps...' is not assignable to type '{ mutate: MutationFunc<AddVisitMutation, OperationVariables>; }'. Types of property 'mutate' are incompatible. Type 'MutationFunc<AddVisitMutation, OperationVariables> | undefined' is not assignable to type 'MutationFunc<AddVisitMutation, OperationVariables>'. Type 'undefined' is not assignable to type 'MutationFunc<AddVisitMutation, OperationVariables>'. C:\myfiles\delete\spring-petclinic-graphql\frontend\src\app\ui\WelcomePage.tsx Error:(7, 7) TS2322:Type '[[string, string], [string, string], [string, string]]' is not assignable to type '[[string, string]]'. Types of property 'length' are incompatible. Type '3' is not assignable to type '1'. Error:(13, 7) TS2322:Type '[[string, string], [string, string], [string, string]]' is not assignable to type '[[string, string]]'.

nilshartmann commented 6 years ago

Hi Imran,

sorry for jumping in so late.

It is very important that you use the correct versions of each javascript module, that is defined in the package.json file, esp the TypeScript, React and Apollo versions must fit together. There have been some major changes in newer versions of this tools, Apollo 2 for example is quite different from Apollo 1.

The best way to make sure that you're using the correct version is, to use yarn, as written in the README file in the root folder of this repository.

The compilation error you pasted is not from Java (Server-part) but from TypeScript (that is used in the frontend). That might be due to wrong javascript packages that can be avoided by using yarn instead of npm.

BTW: If you're new to GraphQL and just want to learn it, this project might not be the best place to start, because it's a quite heavy technology stack. The project is more appropriate for people already knowing grahql and want to see how to combine SpringBoot/GraphQL on the server and GraphQL/React/TypeScript on the client.

So if you want to learn GraphQL:

  1. read the docs at http://graphql.org/learn/

  2. choose an implementation for the serverside (Java, JavaScript, depending on your needs). Using the Spring Boot Starter for GraphQL might not be the best way to start, because it abstracts a lot of things (which is helpful, but not helpful for actually learning the server-side implementation). If you're using java, I would recommend to start with the "pure" java implementation https://github.com/graphql-java/graphql-java

  3. choose an implementation for your client. If you're frontend is JavaScript (and esp if it's React-based) consider using the Apollo Client (https://www.apollographql.com/) that I'm using in this project. (If you're not familiar with TypeScript, start with it's JavaScript API to reduce complexity and the amount of things you have to learn) The apollo client is very well documented and a solid implementation for the client-side.

(4. If you want to try out GraphQL queries, you could use GitHubs GraphQL API: https://developer.github.com/v4/ and https://developer.github.com/v4/explorer/)

Due to lack of time I cannot upgrade this project currently to Apollo 2.0. Maybe I will upgrade in April or May...

Hope that helps, Nils

ikuser commented 6 years ago

Thank you so much Nils.

Your information was very good, It helped me quite lot on it.

I really hope and am looking forward to contributing with you guys.

Thank you

Imran.


From: Nils Hartmann notifications@github.com Sent: Thursday, February 15, 2018 12:07 PM To: spring-petclinic/spring-petclinic-graphql Cc: ikuser; Mention Subject: Re: [spring-petclinic/spring-petclinic-graphql] Incorrect Package Name (#5)

Hi Imran,

sorry for jumping in so late.

It is very important that you use the version of the javascript package, that are defined in the package.json file, esp since TypeScript, React and Apollo versions must fit together and there have been some major changes in newer versions of this tools. Apollo 2 for example is quite different from Apollo 1.

The best way to make sure that you're using the correct version is, to use yarnhttps://yarnpkg.com, as written in the README file in the root folder of this repository.

The compilation error you pasted is not from Java (Server-part) but from TypeScript (that is used in the frontend). That might be due to wrong javascript packages that can be avoided by using yarn instead of npm.

BTW: If you're new to GraphQL and just want to learn it, this project might not be the best place to start, because it's a quite heavy technology stack. The project is more appropriate for people already knowing grahql and want to see how to combine SpringBoot/GraphQL on the server and GraphQL/React/TypeScript on the client.

So if you want to learn GraphQL:

  1. read the docs at http://graphql.org/learn/

  2. choose an implementation for the serverside (Java, JavaScript, depending on your needs). Using the Spring Boot Starter for GraphQL might not be the best way to start, because it abstracts a lot of things (which is helpful, but not helpful for actually learning the server-side implementation). If you're using java, I would recommend to start with the "pure" java implementation https://github.com/graphql-java/graphql-java

  3. choose an implementation for your client. If you're frontend is JavaScript (and esp if it's React-based) consider using the Apollo Client (https://www.apollographql.com/) that I'm using in this project. (If you're not familiar with TypeScript, start with it's JavaScript API to reduce complexity and the amount of things you have to learn) The apollo client is very well documented and a solid implementation for the client-side.

(4. If you want to try out GraphQL queries, you could use GitHubs GraphQL API: https://developer.github.com/v4/ and https://developer.github.com/v4/explorer/)

Due to lack of time I cannot upgrade this project currently to Apollo 2.0. Maybe I will upgrade in April or May...

Hope that helps, Nils

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/spring-petclinic/spring-petclinic-graphql/issues/5#issuecomment-365994861, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ABU8BOHU1ba_iuIrgoi3hPpNiScV8ELdks5tVGQ-gaJpZM4SEIJl.