mirror of
https://github.com/vale981/Vulcan
synced 2025-03-06 01:51:40 -05:00
Fix handling of GraphQL schema-level validation errors in forms. Note: GraphQL errors currently happen before server-side validation errors, instead of happening at the same time.
This commit is contained in:
parent
73edab4858
commit
1258619ef0
4 changed files with 12 additions and 3 deletions
|
@ -14,7 +14,7 @@ const Flash = ({message, type}) => {
|
|||
<li key={index}>{message.content}</li>
|
||||
)}
|
||||
</ul>
|
||||
: <span>message.content</span>
|
||||
: <span>{message.content}</span>
|
||||
}
|
||||
</Alert>
|
||||
)
|
||||
|
|
|
@ -346,7 +346,7 @@ class Form extends Component {
|
|||
|
||||
let message;
|
||||
|
||||
if (error.data.errors) { // this error is a "multi-error" with multiple sub-errors
|
||||
if (error.data && error.data.errors) { // this error is a "multi-error" with multiple sub-errors
|
||||
|
||||
message = error.data.errors.map(error => {
|
||||
return {
|
||||
|
|
|
@ -155,6 +155,15 @@ div.ReactTags__suggestions mark{
|
|||
display: none;
|
||||
}
|
||||
|
||||
.form-errors{
|
||||
.alert{
|
||||
ul{
|
||||
padding: 0 0 0 20px;
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.input-error{
|
||||
color: #EF1642;
|
||||
input, textarea, select{
|
||||
|
|
|
@ -64,7 +64,7 @@ export const getDefaultFragmentText = (collection, options = { onlyViewable: tru
|
|||
/*
|
||||
|
||||
Exclude a field from the default fragment if
|
||||
1. it has a resolver (unless addOriginalField is true)
|
||||
1. it has a resolver and addOriginalField is false
|
||||
2. it has $ in its name
|
||||
3. it's not viewable (if onlyViewable option is true)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue