gridsome-starter-wordpress icon indicating copy to clipboard operation
gridsome-starter-wordpress copied to clipboard

sourceUrl error

Open DavidFyon opened this issue 5 years ago • 10 comments

Error: Cannot query field "sourceUrl" on type "WordPressAttachment".

GraphQL request (36:7) 35: featuredMedia { 36: sourceUrl ^ 37: altText

NB : i run my WP on local with mamp

Can you help me ? Thanks

DavidFyon avatar Jun 01 '19 15:06 DavidFyon

I am getting this same error.

sethharris4989 avatar Jun 13 '19 03:06 sethharris4989

It seems that you need to add a featured image as well as a tag, otherwise it won't compile. If you add an image to your post and add a tag, it should work.

StevenStavrakis avatar Jul 15 '19 17:07 StevenStavrakis

I've spend 2 hours finding this error out. This should be captured by the code when people do not have tags or a featured image.

nitras avatar Aug 22 '19 15:08 nitras

so this issue is not fixed yet???


i am able to fix it by removing lines related to featuredImage (since my site doesn't use featured images at all)

lorvent avatar Dec 28 '19 15:12 lorvent

Could you share your solution?

truc0 avatar Feb 23 '20 06:02 truc0

The requirements won't be satisfied until

  • every post has featured image and tag

  • you need to add tag into the Posts>Tags menu.

Then it will compile.

I personally think that this should be fixed and it should work out-of-the-box with fresh WP setup.

Keromudo avatar Apr 13 '20 18:04 Keromudo

Any updates on this? I am getting the same error.

binnyFriedman avatar Jun 27 '20 08:06 binnyFriedman

if they make tag and featured images optional and show them only if have it...then problem will be fixed.

lorvent avatar Jun 27 '20 09:06 lorvent

Emmmm, it seems to be one of the features of GraphQL.

GraphQL guarantees that you can receive data as the format that you request.

Thus it is hard to make it optional.

truc0 avatar Jun 27 '20 12:06 truc0

Just to confirm, adding a featured image and a tag to posts, fixes the issue.

wbarnard81 avatar Aug 24 '20 12:08 wbarnard81