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 Query Error caused by coverImage #8

Closed
lauragift21 opened this issue Mar 1, 2019 · 10 comments

Comments

@lauragift21
Copy link
Member

commented Mar 1, 2019

I keep coming across this error whenever I delete a post with cover_image in the frontmatter. The error thrown is

Error: Unknown argument "width" on field "coverImage" of type "Post".

@lauragift21 lauragift21 changed the title GraphQL Query Error cause by coverImage GraphQL Query Error caused by coverImage Mar 1, 2019

@hjvedvik

This comment has been minimized.

Copy link
Member

commented Mar 2, 2019

Does this happen while the development server is running or when you start up again after deleting a post?

@lauragift21

This comment has been minimized.

Copy link
Member Author

commented Mar 2, 2019

It happens when I delete the post and start up the server again.

@hjvedvik

This comment has been minimized.

Copy link
Member

commented Mar 2, 2019

I see. Gridsome creates the GraphQL schema based on fields it finds at startup, so that's probably why the coverImage isn't an image field sometimes. We are working on a solution to make Gridsome remember the schema instead of just looking up fields on nodes every time you start the development server, but it's not ready yet :)

@lauragift21

This comment has been minimized.

Copy link
Member Author

commented Mar 2, 2019

Alright, that makes sense. Looking forward to that fix.

@lauragift21 lauragift21 closed this Mar 2, 2019

@SamUndefined

This comment has been minimized.

Copy link

commented Mar 4, 2019

@lauragift21 Have you by chance found a decent workaround in the meantime?

Locally, I've been deleting those arguments, starting the server, and then re-adding them after reboot. On (Netlify) deploy, I just run re-run the build until it works 😬

@lauragift21

This comment has been minimized.

Copy link
Member Author

commented Mar 4, 2019

No I haven't yet. I'm hoping the fix get merged in soon enough.

@kendallroth

This comment has been minimized.

Copy link

commented Mar 16, 2019

I've had this happen whenever I change the image path in frontmatter as follows:

# Builds and displays
cover_image: /images/test.jpg

# Builds but does not display image (doesn't exist?)
cover_image: ./images/test.jpg

# Doesn't build and displays this error (path saved by Netlify CMS)
cover_image: images/test.jpg
@Xstoudi

This comment has been minimized.

Copy link

commented May 24, 2019

Is there an update about this issue ? How can I re-generate the GraphQL schem ?

@miralize

This comment has been minimized.

Copy link

commented Jun 6, 2019

Is there a workaround for this, @hjvedvik?

@eleijonmarck

This comment has been minimized.

Copy link

commented Jul 28, 2019

@Xstoudi @miralize Have you tried?

rm -rf node_modules
rm -rf .cache
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
7 participants
You can’t perform that action at this time.