-
Notifications
You must be signed in to change notification settings - Fork 275
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add union type #134
base: master
Are you sure you want to change the base?
Add union type #134
Conversation
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed. If you have received this in error or have any questions, please contact us at [email protected]. Thanks! |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
I think spacecraft is the most generic name for something flying in outer space.
I also think it's valuable to have atleast one union type in sample API. At the same time I think this API should also be a sample on how you design your schema and in that sense it better to make How about adding {
film(filmID: 1) {
featuredConnection {
featured {
... on Person {
name
}
... on Planet {
name
}
}
}
}
} @Elendev What do you think? |
I agree with you, but the thing is the vehicules doesn't all fly in outer space (ex. the X-34 landspeeder)
It's a good idea. Should I exclude the You do have a point on the |
@Elendev It makes a lot of sense to have standardized fields in all types.
I thought your intention for this PR was to add union type to this API:
I think we need to keep example API as simple as possible and add new types/fields only if we really need to. So fully agree with adding new union type but I don't think we need another Interface type since we already have Another option for union type would be |
…universe (vehicle, starship and Droid)
Yes, it was more a general question than a question for this specific PR.
@IvanGoncharov it's a good idea and it doesn't make me rewrite everything so I went with that. |
@Elendev I will try to review your code in the next couple of days, feel free to ping me otherwise. |
@Elendev Sorry for the delay. I'm working on cleaning up code base and making this project more Windows-friendly and it's taking more time than I estimated initially. |
@IvanGoncharov no problem, thank you for the heads up |
@IvanGoncharov ping |
* | ||
* This source code is licensed under the license found in the | ||
* LICENSE-examples file in the root directory of this source tree. | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please copy updated header from master
import { swapi } from './swapi'; | ||
|
||
// 80+ char lines are useful in describe/it, so ignore in this file. | ||
/* eslint-disable max-len */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both lines not needed after recent changes in master
I've udpated with the last version of I get the following error :
First I thought that the last update of @IvanGoncharov have you already met the same kind of issues or have you any idea on how to fix this ? I have to admit I don't know why it worked before and it's not working anymore. |
To be able to test the union on swapi-graphql I've added a new
MachineType
type.Machine is a union of
VehicleType
andStarshipType
.It comes with the
machine
andallMachines
queries.I'm not sure about the relevance of the name
machine
, so feel free to suggest an other name.