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

Can't get basic example to work #215

Open
altwohill opened this issue Jun 21, 2021 · 4 comments
Open

Can't get basic example to work #215

altwohill opened this issue Jun 21, 2021 · 4 comments

Comments

@altwohill
Copy link

Hi all,

I've been unsuccessful in getting the most basic example of version history working.
I followed the guide here https://docs.silverstripe.org/en/4/developer_guides/model/versioning/#versioning

However I noted that in the POST requests to the graphql endpoint it complained that there wasn't a field called "Version" etc - it appears that things have changed from PascalCase to camelCase.

I've fixed that, and now don't get any errors. Aaaand I don't get anything showing in the history tab.

Here are the files I've added from a fresh composer create-project silverstripe/installer

https://gist.github.com/altwohill/8ae8dbe15095e95ecb1d0a626d162a6f

Any ideas?

@brynwhyman
Copy link

Hi, sounds like you might be seeing: #196

Can you please confirm what version of silverstripe/graphql this project is running? Can do so by running: composer show | grep graphql

@altwohill
Copy link
Author

altwohill commented Jun 24, 2021

Kia ora @brynwhyman,

No, this is still on GraphQL 3

al@DESKTOP-KPR8GHG:~/history$ composer show | grep graphql
silverstripe/graphql                  3.5.0   GraphQL server for SilverStripe models and other data
webonyx/graphql-php                   v0.12.6 A PHP port of GraphQL reference implementation

@brynwhyman
Copy link

Hi @altwohill sorry for the late response. In case you're still working through this, I'd recommend looking at the great community support options where you can get help including our forum, Stack Overflow (remember to tag as silverstripe) and even Slack which can be especially useful.

Sorry I can't be of more help.

@altwohill
Copy link
Author

I originally asked on Slack, and was advised to create an issue here.

I managed to get it working through a fair amount of trial, error, and swearing; the docs appear to assume elemental is installed but don't make any mention of them as a requirement. Also the example provided for the readOne_X_Query has the wrong shape.

I updated the original gist to show what I changed from the docs to get it to work:

https://gist.github.com/altwohill/8ae8dbe15095e95ecb1d0a626d162a6f/revisions

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

No branches or pull requests

3 participants