Expand my Community achievements bar.

July 31st AEM Gems Webinar: Elevate your AEM development to master the integration of private GitHub repositories within AEM Cloud Manager.

AEM GraphQL query "FieldUndefined" error

Avatar

Level 2

I have created Content Fragment Model and its related GraphQL Query in my local AEM and synced with code base and deployed into AEM Servers (TEST & PROD), GraphQL Query working fine till TEST but not working in PROD.

 

I am seeing some inconsistent like same code of Content Fragment Model & GraphQL Query working fine in one AEM environment but not working in another environment.

 

AEM Version: 6.5.19

Error Details: "Validation error of type FieldUndefined: Field 'name' in type 'UserModel' is undefined"

3 Replies

Avatar

Level 5

Hi @karthik-elumalai ,

You may cross check if schema model is defined correctly, if your are deploying hat model make sure it is correctly deployed, published and available.

Seems name field is not present in UserModel schema that environment if that field is not required you may discard that field from query.

Thanks

 

Avatar

Level 2

@MukeshYadav_  Thanks for your reply, actually i am having this Content Fragment Model and GraphQL query in code base, after deployment that same code working in ENG but not working in TEST. 

Avatar

Level 7

Few points to check :
Are the AEM versions same for both the environments ? (working and non working one ) 
Apart from the CFM and persisted query, can you also cross check if the respective graphql endpoint is also present on your environments generally located at /content/cq:graphql
You can open the persisted query in the graphql editor on the environment on which you are facing the issue. If there are any errors with respect to your query/schema validation, you should be able to see the errors in the editor itself and can work on it accordingly. 
If possible, please share the Graphql query and CFM.