Skip to content
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

Allow to resolve automatically Parse Type fields from Custom Schema #6562

Merged

Conversation

Moumouls
Copy link
Member

@Moumouls Moumouls commented Apr 3, 2020

An error occur when you write a custom Mutation/Query that return an auto generated type like User, SomeClass...

For example, currently it fails

extend type Mutation {
   createASpecialUser(): User
}

So we need to inject Auto GraphQL Type fields into the custom one to return a valid User.
Also we need to avoid doing this for roots types to prevent wrong routing during schema execution.

@Moumouls Moumouls added type:bug Impaired feature or lacking behavior that is likely assumed enhancement labels Apr 3, 2020
@Moumouls Moumouls requested a review from davimacedo April 3, 2020 14:37
@Moumouls Moumouls self-assigned this Apr 3, 2020
@codecov
Copy link

codecov bot commented Apr 3, 2020

Codecov Report

Merging #6562 into master will decrease coverage by 0.03%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6562      +/-   ##
==========================================
- Coverage   93.91%   93.88%   -0.04%     
==========================================
  Files         169      169              
  Lines       11967    11965       -2     
==========================================
- Hits        11239    11233       -6     
- Misses        728      732       +4     
Impacted Files Coverage Δ
src/GraphQL/ParseGraphQLSchema.js 97.38% <100.00%> (-0.03%) ⬇️
src/Adapters/Storage/Mongo/MongoStorageAdapter.js 92.85% <0.00%> (-0.67%) ⬇️
src/RestWrite.js 93.81% <0.00%> (-0.17%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 185aaff...082631e. Read the comment docs.

@davimacedo
Copy link
Member

@Moumouls can you please add a test case?

@Moumouls
Copy link
Member Author

I will add test case soon, finally after many tests on my teams graphql parse server (with advanced GraphQL use), i figured out that a simple merge (transfer custom type to auto) combine to replace last types seems to solve all issues and all types/mutation/queries are correctly overloaded.

@Moumouls
Copy link
Member Author

Postgres fail again

@Moumouls
Copy link
Member Author

@davimacedo test case added !

Copy link
Member

@davimacedo davimacedo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@davimacedo davimacedo merged commit f2f7720 into parse-community:master Apr 21, 2020
@mtrezza mtrezza removed type:bug Impaired feature or lacking behavior that is likely assumed 🧬 enhancement labels Jul 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants