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

GraphQL 4 #9087

Merged
merged 43 commits into from
Sep 8, 2022
Merged

GraphQL 4 #9087

merged 43 commits into from
Sep 8, 2022

Conversation

agriffard
Copy link
Member

@agriffard agriffard commented Apr 7, 2021

Giving another try to see if we can migrate to GraphQL 4.

Many changes in versions 3 and 4:
https://graphql-dotnet.github.io/docs/migrations/migration3/
https://graphql-dotnet.github.io/docs/migrations/migration4/

update from @carlwoodhouse

I fixed a bunch of the tests and issues, still some stuff outstanding. Not sure of the state of the lucene stuff either as im not as familiar with that integration but suggest we fix the other issues before that

  • Dynamic fields are broken
  • Custom validators for permissions need re-implementing to new spec
  • Custom validators for max results need re-implementing to new spec - fixed in Update graphql.net to 4.6.1 #10782
  • Check metadata thread safety changes for permissions/part attributes meta
  • Remove asynclock resolver and replace with built in scoped resolver / check this works with parallel execution strategy
  • Check dataloader changes are actually deferring load
  • Check GraphQLFieldNameAttribute changes; how we've resolved it atm doesnt seem right to me ...
  • Not correctly setting response code on auth issues - fixed in Update graphql.net to 4.6.1 #10782
  • buffered stream issue from (Update graphql.net to 4.6.1 #10782)

@carlwoodhouse
Copy link
Member

carlwoodhouse commented Apr 7, 2021 via email

Copy link
Member

@carlwoodhouse carlwoodhouse left a comment

Choose a reason for hiding this comment

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

@agriffard these are more notes then anything; will checkout your branch and try and resolve the remaining issues + anything ele; main convern is that im not sure the dataloaders will be working as intended atm

@@ -36,9 +37,9 @@ public ListQueryObjectType(IStringLocalizer<ListQueryObjectType> S)

var dataLoader = accessor.Context.GetOrAddCollectionBatchLoader<string, ContentItem>("ContainedPublishedContentItems", x => LoadPublishedContentItemsForListAsync(x, session));

return (await dataLoader.LoadAsync(g.Source.ContentItem.ContentItemId))
return ((await dataLoader.LoadAsync(g.Source.ContentItem.ContentItemId).GetResultAsync())
Copy link
Member

Choose a reason for hiding this comment

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

i need to read up on the dataloader changes; but this doesnt seem right ... seems like it would return the results immediately rather then batching them into a dataloader

Copy link
Member

Choose a reason for hiding this comment

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

yes this seems odd

@carlwoodhouse
Copy link
Member

Now i fixed some stuff theres another bunch of compilation errors ;) will do some more over the weekend @agriffard

@carlwoodhouse
Copy link
Member

theres changes around how the execution strat works for dataloaders too we will need to change; can probably remove the asynclockresolver we implemented now we can use a serial start with dataloaders and some other di changes to enforce the right scopes

@carlwoodhouse

This comment has been minimized.

@carlwoodhouse
Copy link
Member

@agriffard
Copy link
Member Author

Sorry @carlwoodhouse , it was to fix ShouldFilterByCollapsedWhereInputForCollapsedParts that makes an exception:

System.InvalidCastException : Unable to cast object of type 'GraphQL.Types.StringGraphType' to type 'GraphQL.Types.ListGraphType'.

@carlwoodhouse
Copy link
Member

carlwoodhouse commented Apr 9, 2021 via email

@agriffard
Copy link
Member Author

Can you fix the conflicts @agriffard ? thanks

Solved.

@MikeKry
Copy link
Contributor

MikeKry commented Feb 10, 2022

@carlwoodhouse

is there any description of graphql n+1 issue so I could try to look at dataloaders myself?

I would love to have this merged as current version is not compatible with gatsby.

{
throw new ArgumentNullException(nameof(message));
await documentWriter.WriteAsync(stream, value);
Copy link
Member

Choose a reason for hiding this comment

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

Adding a comment here since the one before got removed

@MikeKry
Copy link
Contributor

MikeKry commented Mar 9, 2022

There might be another thing to solve (both on old and new implementation)

Sometimes when you create new field that is also in graphql - you need to reset CMS (either by reload tenant or some other action) to make it work correctly. Also it seems that is works in graphql viewer in CMS instantly but when accessed through API it is cached or something (but CMS reload helps, does not need to be changed on client site).

Otherwise no errors till now.

@agriffard
Copy link
Member Author

@agriffard
Copy link
Member Author

@MikeKry
Copy link
Contributor

MikeKry commented Apr 5, 2022

so,... shall I update it to GraphQL 5 ?
Or will dataloaders be solved first before that?

@MikeKry
Copy link
Contributor

MikeKry commented Apr 7, 2022

I have addressed issue with buffered stream - if its ok it can be merged into this branch.

Tomorrow I plan to look at dataloaders, possibly updateto GQL 5 if it is wanted.

@agriffard
Copy link
Member Author

Also started 1 year ago.

@agriffard
Copy link
Member Author

ping @sebastienros

@MikeKry
Copy link
Contributor

MikeKry commented Sep 3, 2022

It seems RequiresPermissionValidationRuleTests is broken due to changes in newtonsoft/systemtextjson, but otherwise we are running projects on this branch for a long time without problems.

I did not manage to find the problem with dataloaders though.

@sebastienros sebastienros merged commit 6a69e25 into main Sep 8, 2022
@sebastienros sebastienros deleted the ag/graphql4 branch September 8, 2022 18:01
@Skrypt
Copy link
Contributor

Skrypt commented Sep 8, 2022

Will we have someone working to get this up to GraphQL.NET 7.0.2 ?

@Skrypt Skrypt removed the notready label Sep 10, 2022
@MikeKry
Copy link
Contributor

MikeKry commented Nov 16, 2022

Would give sense, there are interesting query complexity calculation changes that could positively influence headless apps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants