Closed kcole93 closed 3 years ago
@kcole93 That is odd - I don't suppose you have a public repo I could test this out on, or a codesandbox reproduction?
I've added you to a repo, but I think I've figured it out. There appears to be a _name_space issue with the word name
. When I changed the field's name to documentName
, everything works as expected 🤦♂️.
Edit: Spoke too soon...
It turns out that there's something going on with the way that naming conventions are handled either in the Gridsome Airtable Source plugin or across plugins. Although the GraphQL Explorer shows the collection's fields in camel case, flexsearch only seems to index them correctly if field names in the source Airtable base exactly match the fields entered in the searchFields
and fields
options. slug
was being picked up correctly as that field's name in the Airtable base was also slug
in all lowercase.
I'm experiencing an odd issue whereby only the
id
,path
andslug
fields of a collection are being added to each item in the flexsearch index, with all other fields being ignored.Upon running
gridsome develop
, I am notified that, as expected, all nodes in my collection were successfully added to the search index, but upon inspecting flexsearch.json, only the above three fields are included for each node in the index entry (name
andtype
are not included):Yet when querying in the GraphQL explorer, I have no issues retrieving these fields' values:
Returns:
Everything also seems okay when looking at the schema of the type Document:
For reference, my environment is:
I don't think it should be relevant, but I am using the gridsome/source-airtable plugin to build the Document collection by fetching records from Airtable, but it appears that sources and the GraphQL schema are created before the Search Index, so this shouldn't be a problem.