Comments (12)
This fixes the unresolved refs issue: #66
from gatsby-source-sanity.
I did more research and an attempt at fixing this today.
- no references work as expected and gives you a usable portable(despite #37 claiming otherwise)
document {
object {
_rawPortable
}
}
- top level field portable with refs work
document {
_rawPortable(resolveReferences: {maxDepth: 10})
}
- but portable nested in object does not dereference the { _ref } objects
document {
object {
_rawPortable(resolveReferences: {maxDepth: 10})
}
}
I got annoying error like "_rawTitle: incorrect OutputType: JSON"from graphql-compose when using npm link on gatsby-source-sanity into my gatsby project, so couldn't actually debug this properly, but just using DEBUG=sanity gave a clue that
resolveReferences was called for the object with _ref, but it gave the error message here:
from gatsby-source-sanity.
Does the referenced document still exist? I see the reference is set to weak.
from gatsby-source-sanity.
Hey Espen,
yes I log several items which all are referenced to different documents, but good point.
from gatsby-source-sanity.
@rexxars is there any news on this?
from gatsby-source-sanity.
I, too, have this issue, though I don't have any _weak
attribute within my unique mark
attribute object.
from gatsby-source-sanity.
I investigated a bit further.
Lets say you have those two document types (just for testing purposes)
export default {
name: 'page',
title: 'Page',
type: 'document',
fields: [
{
name: 'link',
title: 'Link',
type: 'reference',
}
]
}
and
export default {
name: 'job',
title: 'Job',
type: 'document',
fields: [
{
name: 'page',
title: 'Page',
type: 'page',
},
],
};
The reference of page will work where the reference of jobs wont work so i guess theres a type nesting problem regarding reference types
I would be available to go through it in google meet or so to investigate further with you @rexxars if you would like
from gatsby-source-sanity.
this does work for documents referenced to from inside blockcontent. I use a catch all depth 10 on all graphql queries on blockcontent. could perhaps your nesting be deeper than 10?
from gatsby-source-sanity.
roffelsaurus to the rescue !
can you describe closer what you mean with catch all ?
regarding the deeper than 10 thing, i've set it to 5000 just to try but that had no impact.
from gatsby-source-sanity.
I am also seeing unresolved references when they are nested
from gatsby-source-sanity.
from gatsby-source-sanity.
For me, it doesn't resolve image references within any bodyPortableText
blocks
from gatsby-source-sanity.
Related Issues (20)
- Dependency Dashboard
- Can't get GatsbyImageData from Image in Block element HOT 7
- Need to build from a previous export of the dataset
- GraphQLError: Runtime Object type "SanityImage" is not a possible type for "Image". when querying an array of images HOT 1
- Is the __node-manifests directory necessary for builds to run? HOT 3
- Planned support for Gatsby 5? HOT 5
- ERROR #11321 PLUGIN After update to 7.6.0 HOT 13
- getGatsbyImageData Unhandled Runtime Error HOT 2
- Include image filename with getGatsbyImageData
- SanityImageAsset options aren't passed to Gatsby-Plugin-Image HOT 4
- crash desk tool - Error: Cannot get the start point in the node at path [1] because it has no start text node. HOT 1
- Mux assets are not resolved when there's a cache
- Error building gatsby after updating to 7.7.0 HOT 14
- Null values in graphql HOT 1
- ID field for reference types is null in graphql HOT 2
- Not able to filter ImageAssets by MediaTag
- Gatsby Config requires definition for "apiHost"
- [Feature Request] Add support for perspectives in plugin options
- Error: Unable to serialize object as a key
- Error: EINVAL: invalid argument
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gatsby-source-sanity.